Bug #73684 [NEW]: Can be segmentation fault
| From: | deepvavar at mail dot ru | Date: | Thu, 08 Dec 2016 11:58:26 +0000 |
| Subject: | Bug #73684 [NEW]: Can be segmentation fault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205837@lists.php.net to get a copy of this message | ||
From: deepvavar at mail dot ru
Operating system: All
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:Can be segmentation fault
Description:
------------
Can be segmentation fault
Test script:
---------------
<?php
class a
{
public function getNewB()
{
$b = new b();
$b->a = $this;
return $b;
}
}
class b
{
public $a = null;
public $b = null;
}
class x
{
public static $a = null;
public static $b = null;
public static function foo()
{
self::$a = new a();
self::$b = self::$a->getNewB();
self::bar(self::$b);
}
public static function bar($b)
{
$b->b = self::$a->getNewB();
self::bar($b->b);
}
}
x::foo();
Expected result:
----------------
Without segfault
Actual result:
--------------
~$ php test.php
Segmentation fault
~$ php -v
PHP 5.6.22-0+deb8u1 (cli) (built: Jun 13 2016 07:55:54)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend
Technologies
~$ cat /etc/debian_version
8.5
------------------------------------------
Fatal error: Maximum function nesting level of '100' reached, aborting!
Windows, php 5.4
------------------------------------------
> php test.php
fish: âphp test.phpâ terminated by signal SIGSEGV (Address boundary
error)
> php -version
PHP 5.6.28 (cli) (built: Nov 9 2016 07:56:15)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
------------------------------------------
# php t.php
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 130968 bytes) in /t.php on line 29
# php -v
PHP 5.6.28 (cli) (built: Dec 6 2016 22:12:29)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
With php 7.1: Fatal error: Allowed memory size
------------------------------------------
~$ php test.php
Segmentation fault
~$ php -v
PHP 7.0.13-2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.13-2, Copyright (c) 1999-2016, by Zend
Technologies
------------------------------------------
$ php test.php
Segmentation fault
$ php -v
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016,
by Zend Technologies
--
Edit bug report at https://bugs.php.net/bug.php?id=73684&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73684&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73684&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73684&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73684&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73684&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73684&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73684&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73684&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73684&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73684&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73684&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73684&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73684&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73684&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73684&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73684&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73684&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73684&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73684&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73684&r=mysqlcfg