php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40565 segmentation fault
Submitted: 2007-02-20 19:03 UTC Modified: 2007-02-21 20:58 UTC
From: ThomasxHolder at compuserve dot de Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.2.1 OS: Solaris 9
Private report: No CVE-ID: None
 [2007-02-20 19:03 UTC] ThomasxHolder at compuserve dot de
Description:
------------
We are running php-5.1.6 on solaris 5.9 (sparc64). Since php-5.2.0 all attemts to update failed. A simple echo test works, but almost everything else causes segmentation fault. "make test" stops in the very beginning with "make: [test] Error 139 (ignored)".

Reproduce code:
---------------
$ cat test.php
<?php
echo str_replace("foo", "bar", "foofoo\n");
?>

$ gdb ../sapi/cli/php
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) set args test.php
(gdb) run
Starting program: /tmp/holder/php-5.2.1/sapi/cli/php test.php
*zval_ptr is null...

Program received signal SIGSEGV, Segmentation fault.
_zval_ptr_dtor (zval_ptr=0xffbfe634) at /tmp/holder/php-5.2.1/Zend/zend_execute_API.c:416
416             (*zval_ptr)->refcount--;
(gdb) backtrace
#0  _zval_ptr_dtor (zval_ptr=0xffbfe634) at /tmp/holder/php-5.2.1/Zend/zend_execute_API.c:416
#1  0x00189b3c in zend_do_fcall_common_helper_SPEC (execute_data=0xffbfe6c8) at zend_execute.h:155
#2  0x00187c40 in execute (op_array=0x2d7da8) at zend_vm_execute.h:92
#3  0x0016c390 in zend_execute_scripts (type=8, retval=Variable "retval" is not available.
) at /tmp/holder/php-5.2.1/Zend/zend.c:1135
#4  0x0012d330 in php_execute_script (primary_file=0xffbfedf0) at /tmp/holder/php-5.2.1/main/main.c:1784
#5  0x001ff870 in main (argc=2, argv=0xffbfee9c) at /tmp/holder/php-5.2.1/sapi/cli/php_cli.c:1114
(gdb) quit

I inserted
    if ((*zval_ptr) == NULL) {
        printf("*zval_ptr is null...\n");
    }
into Zend/zend_execute_API.c, for that the error occurs in line 416 and not in line 412

Actual result:
--------------
Segmentation fault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-20 19:12 UTC] tony2001@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


 [2007-02-21 20:58 UTC] ThomasxHolder at compuserve dot de
wow, it's fixed, thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC