From:             eyal at zend dot com
Operating system: Linux
PHP version:      5.2.6
PHP Bug Type:     Scripting Engine problem
Bug description:  Segmentation fault when executing bug41037.phpt on apache 
module

Description:
------------
I executed bug41037.phpt on apache module.
The result I got is that first request passes successfully, but next
requests causes segmentation fault.

To reproduce place the script from reproduction code section in your
htdocs and request it as follows:
ab -n1000 -c10 [URL]


Note that all zend extensions were not loaded at the time of the test

Reproduce code:
---------------
<?php

function a() {
        echo "hello";
            unregister_tick_function('a');
}

declare (ticks=1);
register_tick_function('a');

echo "Done\n";
?>

Expected result:
----------------
hello
Warning\: unregister_tick_function\(\)\: Unable to delete tick function
executed at the moment in
.+? on line [0-9]+
Done
hello
Warning\: unregister_tick_function\(\)\: Unable to delete tick function
executed at the moment in
.+? on line [0-9]+
hello
Warning\: unregister_tick_function\(\)\: Unable to delete tick function
executed at the moment in
.+? on line [0-9]+

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

BT:
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1216579920 (LWP 23236)]
zend_llist_apply (l=0x0, func=0xb740a6f0 <user_tick_function_call>) at
/php-5.2.6/Zend/zend_llist.c:192
192             for (element=l->head; element; element=element->next) {
(gdb) bt
#0  zend_llist_apply (l=0x0, func=0xb740a6f0 <user_tick_function_call>) at
/php-5.2.6/Zend/zend_llist.c:192
#1  0xb7407f9c in run_user_tick_functions (tick_count=1) at
/php-5.2.6/ext/standard/basic_functions.c:5364
#2  0xb747c068 in php_tick_iterator (data=0x83a3438, arg=0xbf8b77e0) at
/php-5.2.6/main/php_ticks.c:64
#3  0xb74a42ec in zend_llist_apply_with_argument (l=0xb77a2444,
func=0xb747c050 <php_tick_iterator>, arg=0xbf8b77e0) at
/php-5.2.6/Zend/zend_llist.c:236
#4  0xb747c042 in php_run_ticks (count=1) at
/php-5.2.6/main/php_ticks.c:71
#5  0xb74c98d5 in ZEND_TICKS_SPEC_CONST_HANDLER (execute_data=0xbf8b7850)
at /php-5.2.6/Zend/zend_vm_execute.h:2377
#6  0xb74cae28 in execute (op_array=0x835ff88) at
/php-5.2.6/Zend/zend_vm_execute.h:92
#7  0xb74ad404 in zend_execute_scripts (type=8, retval=<value optimized
out>, file_count=3) at /php-5.2.6/Zend/zend.c:1134
#8  0xb746dc60 in php_execute_script (primary_file=0xbf8b9af8) at
/php-5.2.6/main/main.c:2005
#9  0xb7528591 in php_handler (r=0x83a1478) at
/php-5.2.6/sapi/apache2handler/sapi_apache2.c:629
#10 0x08079259 in ap_run_handler ()
#11 0x0807c5b7 in ap_invoke_handler ()
#12 0x08089998 in ap_process_request ()
#13 0x08086c9b in ?? ()
#14 0x083a1478 in ?? ()
#15 0x00000004 in ?? ()
#16 0x083a1478 in ?? ()
#17 0x00000000 in ?? ()


-- 
Edit bug report at http://bugs.php.net/?id=45352&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45352&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45352&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45352&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45352&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45352&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45352&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45352&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45352&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45352&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45352&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45352&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45352&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45352&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45352&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45352&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45352&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45352&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45352&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45352&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45352&r=mysqlcfg

Reply via email to