From: arpad at rajeczy dot com
Operating system: Ubuntu Linux 6.1 (2.6.17) x86_64
PHP version: 5.2.1RC2
PHP Bug Type: Reproducible crash
Bug description: Seg fault on exit/die using php -r
Description:
------------
`php script.php` where script.php contains '<?php die("hi");' works fine,
but `php -r 'die("hi");'` consistently produces a segfault.
Reproduce code:
---------------
php -r 'die("hi");'
Expected result:
----------------
hi
Actual result:
--------------
(gdb) run -r 'die("hi");'
Starting program: /usr/local/bin/php -r 'die("hi");'
[Thread debugging using libthread_db enabled]
[New Thread 47562387643536 (LWP 12803)]
hi
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47562387643536 (LWP 12803)]
0x000000000063e68c in zend_hash_index_find (ht=0x8ea578, h=1,
pData=0x7fffb0721908)
at /installs/php/php-5.2.1RC2/Zend/zend_hash.c:969
969 p = ht->arBuckets[nIndex];
(gdb) bt
#0 0x000000000063e68c in zend_hash_index_find (ht=0x8ea578, h=1,
pData=0x7fffb0721908) at
/installs/php/php-5.2.1RC2/Zend/zend_hash.c:969
#1 0x0000000000641b20 in _zend_list_delete (id=<value optimized out>,
tsrm_ls=0x8e6030) at /installs/php/php-5.2.1RC2/Zend/zend_list.c:55
#2 0x0000000000624ac5 in free_zend_constant (c=0x8ea578)
at /installs/php/php-5.2.1RC2/Zend/zend_variables.h:35
#3 0x000000000063ed78 in zend_hash_destroy (ht=0x8e99a0)
at /installs/php/php-5.2.1RC2/Zend/zend_hash.c:521
#4 0x000000000063431c in executor_globals_dtor
(executor_globals=0x8ea2f0,
tsrm_ls=0x8e6030) at /installs/php/php-5.2.1RC2/Zend/zend.c:517
#5 0x00000000005e7c11 in tsrm_shutdown ()
at /installs/php/php-5.2.1RC2/TSRM/TSRM.c:180
#6 0x00000000006ba45a in main (argc=3, argv=0x7fffb0721e68)
at /installs/php/php-5.2.1RC2/sapi/cli/php_cli.c:1283
--
Edit bug report at http://bugs.php.net/?id=40045&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=40045&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=40045&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=40045&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40045&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=40045&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40045&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40045&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40045&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40045&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40045&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=40045&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=40045&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40045&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40045&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40045&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40045&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40045&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40045&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40045&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40045&r=mysqlcfg