Bug #70918 [NEW]: Segfault using static outside of class scope
| From: | leigh@php.net | Date: | Sun, 15 Nov 2015 02:06:25 +0000 |
| Subject: | Bug #70918 [NEW]: Segfault using static outside of class scope | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-197259@lists.php.net to get a copy of this message | ||
From: leigh@php.net
Operating system: Linux
PHP version: master-Git-2015-11-15 (Git)
Package: Reproducible crash
Bug Type: Bug
Bug description:Segfault using static outside of class scope
Description:
------------
Using static outside of a class scope causes a segfault in git master.
7.0 is _not_ affected.
https://3v4l.org/nOblY
Test script:
---------------
<?php
static::x;
Expected result:
----------------
Fatal error: Cannot access static:: when no class scope is active in
....
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
0x0000000000d99464 in zend_hash_find_bucket (ht=0xb0,
ht@entry=0x7ffff6855430, ht=0xb0, ht@entry=0x7ffff6855430,
key=0x7ffff6855380) at /home/leigh/php-src/Zend/zend_hash.c:437
437 nIndex = h | ht->nTableMask;
(gdb) bt
#0 0x0000000000d99464 in zend_hash_find_bucket (ht=0xb0,
ht@entry=0x7ffff6855430, ht=0xb0, ht@entry=0x7ffff6855430,
key=0x7ffff6855380) at /home/leigh/php-src/Zend/zend_hash.c:437
#1 zend_hash_find (ht=ht@entry=0xb0, key=0x7ffff6855380) at
/home/leigh/php-src/Zend/zend_hash.c:1890
#2 0x0000000000edddf8 in
ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUSED_CONST_HANDLER () at
/home/leigh/php-src/Zend/zend_vm_execute.h:23918
#3 0x0000000000ec3ff3 in execute_ex (ex=<optimized out>) at
/home/leigh/php-src/Zend/zend_vm_execute.h:414
#4 0x00000000010b8d7b in zend_execute
(op_array=op_array@entry=0x7ffff687e000,
return_value=return_value@entry=0x0) at
/home/leigh/php-src/Zend/zend_vm_execute.h:458
#5 0x0000000000cc5abc in zend_execute_scripts (type=type@entry=8,
retval=retval@entry=0x0, file_count=-159305680, file_count@entry=3) at
/home/leigh/php-src/Zend/zend.c:1428
#6 0x0000000000a85968 in php_execute_script
(primary_file=0x7fffffffd2d0) at /home/leigh/php-src/main/main.c:2471
#7 0x00000000010c0911 in do_cli (argc=176, argv=0x7ffff6855380) at
/home/leigh/php-src/sapi/cli/php_cli.c:974
#8 0x000000000042ff61 in main (argc=176, argv=0x7ffff6855380) at
/home/leigh/php-src/sapi/cli/php_cli.c:1345
--
Edit bug report at https://bugs.php.net/bug.php?id=70918&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70918&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70918&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70918&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70918&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70918&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70918&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70918&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70918&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70918&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70918&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70918&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70918&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70918&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70918&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70918&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70918&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70918&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70918&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70918&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70918&r=mysqlcfg