php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40045 Seg fault on exit/die using php -r
Submitted: 2007-01-06 18:05 UTC Modified: 2007-01-06 19:14 UTC
From: arpad at rajeczy dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.2.1RC2 OS: Ubuntu Linux 6.1 (2.6.17) x86_64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 + 22 = ?
Subscribe to this entry?

 
 [2007-01-06 18:05 UTC] arpad at rajeczy dot com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-06 18:22 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Seems to work fine in latest CVS.
 [2007-01-06 19:14 UTC] arpad at rajeczy dot com
Yep, that snap fixes it. Cheers.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC