Bug #78151 [NEW]: Segfault caused by indirect expressions in PHP 7.4a1
| From: | jfcherng at gmail dot com | Date: | Wed, 12 Jun 2019 19:54:39 +0000 |
| Subject: | Bug #78151 [NEW]: Segfault caused by indirect expressions in PHP 7.4a1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-221256@lists.php.net to get a copy of this message | ||
From: jfcherng at gmail dot com
Operating system: Win7 x64
PHP version: Next Minor Version
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Segfault caused by indirect expressions in PHP 7.4a1
Description:
------------
I downloaded the PHP 7.4 alpha 1 release from
"https://windows.php.net/downloads/qa/php-7.4.0alpha1-nts-Win32-vs16-x64.zip"
and decompressed it without any modification (I did not even create a
php.ini).
I then ran the attached test script with the PHP QA release ( $ php.exe
test.php ) and got a segfault. I *cannot* reproduce this issue on my
CentOS machine somehow.
Test script:
---------------
<?php
class Arr
{
private $foo = '';
public function __construct(array $array = [])
{
$property = 'foo';
// segfault in PHP 7.4.0alpha1 but is fine in PHP 7.3.7RC1
$this->{$property} = &$array[$property];
// this is fine in both PHP versions
// $this->foo = &$array[$property];
\var_dump($this->foo);
}
}
$arr = new Arr(['foo' => 'bar']);
Expected result:
----------------
string(3) "bar"
Actual result:
--------------
Segmentation fault
--
Edit bug report at https://bugs.php.net/bug.php?id=78151&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78151&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78151&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78151&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78151&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78151&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78151&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78151&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78151&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78151&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78151&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78151&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78151&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78151&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78151&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78151&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78151&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78151&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78151&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78151&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78151&r=mysqlcfg