From: [EMAIL PROTECTED]
Operating system: Linux 64bit
PHP version: 4.4.7
PHP Bug Type: Scripting Engine problem
Bug description: possible crash on script execution timeout
Description:
------------
The crash is really rare, but seems to be possible.
According to the core, it happened when script execution timed out and
active_opline pointer was NULL at that moment, so
zend_get_executed_lineno() tried to dereference NULL ptr.
Even though the backtrace mentions Zend Opimizer, it doesn't seem to be
required to reproduce the crash and it is not PHP4 specific.
Reproduce code:
---------------
.
Expected result:
----------------
.
Actual result:
--------------
(gdb) bt
#0 0x000000000052d7d1 in zend_get_executed_lineno () at
/shared/misc/standard/php.src/php-4.4.7/Zend/zend_execute_API.c:269
#1 0x0000000000536c4b in zend_error (type=1, format=0x6ce4b8 "Maximum
execution time of %d second%s exceeded")
at /shared/misc/standard/php.src/php-4.4.7/Zend/zend.c:760
#2 <signal handler called>
#3 0x0000002a97194f2b in zend_optimizer_set_oe_ex () from
/local/Zend/lib/php-4.4.x/ZendOptimizer.so
#4 0x0000002a97194f16 in zend_optimizer_set_oe_ex () from
/local/Zend/lib/php-4.4.x/ZendOptimizer.so
#5 0x0000002a97194f16 in zend_optimizer_set_oe_ex () from
/local/Zend/lib/php-4.4.x/ZendOptimizer.so
#6 0x0000002a97194f16 in zend_optimizer_set_oe_ex () from
/local/Zend/lib/php-4.4.x/ZendOptimizer.so
#7 0x0000002a97194f16 in zend_optimizer_set_oe_ex () from
/local/Zend/lib/php-4.4.x/ZendOptimizer.so
#8 0x00000000005365bf in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /shared/misc/standard/php.src/php-4.4.7/Zend/zend.c:939
#9 0x00000000004fe699 in php_execute_script (primary_file=0x7fbffffb20)
at /shared/misc/standard/php.src/php-4.4.7/main/main.c:1784
#10 0x0000000000557bfd in main (argc=5, argv=0x7fbffffc78) at
/shared/misc/standard/php.src/php-4.4.7/sapi/cgi/cgi_main.c:2236
Further investigation has shown that active_opline is NULL:
(gdb) f 0
#0 0x000000000052d7d1 in zend_get_executed_lineno () at
/shared/misc/standard/php.src/php-4.4.7/Zend/zend_execute_API.c:269
269 /shared/misc/standard/php.src/php-4.4.7/Zend/zend_execute_API.c:
No such file or directory.
in
/shared/misc/standard/php.src/php-4.4.7/Zend/zend_execute_API.c
(gdb) p executor_globals.opline_ptr
$3 = (zend_op **) 0x7fbfff9510
(gdb) p *executor_globals.opline_ptr
$4 = (zend_op *) 0x0
--
Edit bug report at http://bugs.php.net/?id=43136&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43136&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43136&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43136&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43136&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43136&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43136&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43136&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43136&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43136&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43136&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43136&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43136&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43136&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43136&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43136&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43136&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43136&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43136&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43136&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43136&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43136&r=mysqlcfg