Bug #78151 [Ver]: Segfault caused by indirect expressions in PHP 7.4a1
Edit report at https://bugs.php.net/bug.php?id=78151&edit=1
ID: 78151
Updated by: krakjoe@php.net
Reported by: jfcherng at gmail dot com
Summary: Segfault caused by indirect expressions in PHP 7.4a1
Status: Verified
Type: Bug
Package: Scripting Engine problem
Operating System: Win7 x64
PHP Version: Next Minor Version
Block user comment: N
Private report: N
New Comment:
First 7.4 build: https://dev.azure.com/phpazuredevops/PHP/_build/results?buildId=173
Previous Comments:
------------------------------------------------------------------------
[2019-06-12 20:46:20] krakjoe@php.net
Test added, first CI build that includes it is: https://dev.azure.com/phpazuredevops/PHP/_build/results?buildId=172
------------------------------------------------------------------------
[2019-06-12 20:01:20] nikic@php.net
Also repros on Ubuntu for me.
------------------------------------------------------------------------
[2019-06-12 19:54:39] jfcherng at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=78151&edit=1
Thread (7 messages)