Bug #53022 [NEW]: Segfault in php-cgi after executing a script with syntax error
| From: | hightman at twomice dot net | Date: | Fri, 08 Oct 2010 08:44:19 +0000 |
| Subject: | Bug #53022 [NEW]: Segfault in php-cgi after executing a script with syntax error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-155018@lists.php.net to get a copy of this message | ||
From:
Operating system: FreeBSD Linux
PHP version: 5.3.3
Package: Reproducible crash
Bug Type: Bug
Bug description:Segfault in php-cgi after executing a script with syntax error
Description:
------------
Every php-cgi/fastcgi process was designed to handle multi requests, but
after executing a script file which has syntax error, the php-cgi will
crash when next request comming in.
Test script:
---------------
1. start the php-cgi:
php-cgi -b /tmp/php53/php-cgi.sock
2. simple test script with syntax error:
<?php $++; ?>
3. run twice requests to this script
Actual result:
--------------
The first time, request was handled normally, but the second time, php-cgi
crashed.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x0000000100418211 in _zend_mm_alloc_int (heap=0x101025a00, size=4) at
/Users/hightman/Temp/setup/php-5.3.3/Zend/zend_alloc.c:1825
1825 heap->cache[index] =
best_fit->prev_free_block;
(gdb) bt
#0 0x0000000100418211 in _zend_mm_alloc_int (heap=0x101025a00, size=4) at
/Users/hightman/Temp/setup/php-5.3.3/Zend/zend_alloc.c:1825
#1 0x00000001004196cc in _emalloc (size=4) at
/Users/hightman/Temp/setup/php-5.3.3/Zend/zend_alloc.c:2340
#2 0x0000000100432af4 in init_op_array (op_array=0x100e5c2d0, type=2
'\002', initial_ops_size=64) at
/Users/hightman/Temp/setup/php-5.3.3/Zend/zend_opcode.c:63
#3 0x00000001003fa309 in compile_file (file_handle=0x7fff5fbfd660, type=8)
at zend_language_scanner.l:351
#4 0x000000010043f8ee in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /Users/hightman/Temp/setup/php-5.3.3/Zend/zend.c:1186
#5 0x00000001003c6e01 in php_execute_script (primary_file=0x7fff5fbfd660)
at /Users/hightman/Temp/setup/php-5.3.3/main/main.c:2260
#6 0x00000001005222f3 in main (argc=3, argv=0x7fff5fbff850) at
/Users/hightman/Temp/setup/php-5.3.3/sapi/cgi/cgi_main.c:2109
--
Edit bug report at http://bugs.php.net/bug.php?id=53022&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53022&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53022&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53022&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53022&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53022&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53022&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53022&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53022&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53022&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53022&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53022&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53022&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53022&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53022&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53022&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53022&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53022&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53022&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53022&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53022&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53022&r=mysqlcfg