Bug #81021 [NEW]: Seg fault while calling closure from Reflection
| From: | lukin dot andrej at gmail dot com | Date: | Sat, 08 May 2021 12:14:29 +0000 |
| Subject: | Bug #81021 [NEW]: Seg fault while calling closure from Reflection | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233744@lists.php.net to get a copy of this message | ||
From: lukin dot andrej at gmail dot com
Operating system: Mac OS 11.3.1
PHP version: 8.0.6
Package: Reflection related
Bug Type: Bug
Bug description:Seg fault while calling closure from Reflection
Description:
------------
I'm receiving a seg. fault running the code below.
The backtrace is not much informative for this call.
(gdb) bt
#0 0x00007fff207a5552 in ?? ()
#1 0x00007ffeefbfe530 in ?? ()
#2 0x00000001002b8d5c in ?? ()
#3 0x00007ffeefbfdc80 in ?? ()
#4 0x00007fff204d6797 in ?? ()
#5 0x000000000000002e in ?? ()
#6 0x0000000105f4ba50 in ?? ()
#7 0x0000000000000019 in ?? ()
#8 0x0000000105805680 in ?? ()
#9 0x0000000105f4ba50 in ?? ()
#10 0x0000000000000000 in ?? ()
Test script:
---------------
class Test
{
private string $name;
public function __construct(string $name)
{
$this->name = $name;
}
}
$class = new ReflectionClass(Test::class);
$instance = \Closure::fromCallable([$class,
'newInstanceWithoutConstructor']);
$instance();
Actual result:
--------------
(gdb) bt
#0 0x00007fff207a5552 in ?? ()
#1 0x00007ffeefbfe530 in ?? ()
#2 0x00000001002b8d5c in ?? ()
#3 0x00007ffeefbfdc80 in ?? ()
#4 0x00007fff204d6797 in ?? ()
#5 0x000000000000002e in ?? ()
#6 0x0000000105f4ba50 in ?? ()
#7 0x0000000000000019 in ?? ()
#8 0x0000000105805680 in ?? ()
#9 0x0000000105f4ba50 in ?? ()
#10 0x0000000000000000 in ?? ()
--
Edit bug report at https://bugs.php.net/bug.php?id=81021&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81021&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81021&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81021&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81021&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81021&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81021&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81021&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81021&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81021&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81021&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81021&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81021&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81021&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81021&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81021&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81021&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81021&r=mysqlcfg