#40565 [Fbk->Csd]: segmentation fault
| From: | ThomasxHolder at compuserve dot de | Date: | Wed, 21 Feb 2007 20:58:58 +0000 |
| Subject: | #40565 [Fbk->Csd]: segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-109301@lists.php.net to get a copy of this message | ||
ID: 40565
User updated by: ThomasxHolder at compuserve dot de
Reported By: ThomasxHolder at compuserve dot de
-Status: Feedback
+Status: Closed
Bug Type: Reproducible crash
Operating System: Solaris 9
PHP Version: 5.2.1
New Comment:
wow, it's fixed, thanks!
Previous Comments:
------------------------------------------------------------------------
[2007-02-20 19:12:57] 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-20 19:03:57] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40565&edit=1