Bug #66418 [Opn]: Segmentation fault while header_register_callback
Edit report at https://bugs.php.net/bug.php?id=66418&edit=1
ID: 66418
User updated by: P dot Rehs at gmx dot net
Reported by: P dot Rehs at gmx dot net
-Summary: Segmentation fault while sending headers
+Summary: Segmentation fault while header_register_callback
Status: Open
Type: Bug
Package: HTTP related
Operating System: Linux
PHP Version: 5.5.7
Block user comment: N
Private report: N
New Comment:
I tracked down the issue to header_register_callback
Everything works fine with register_shutdown_function but not when called from
header_register_callback.
Previous Comments:
------------------------------------------------------------------------
[2014-01-05 15:30:11] P dot Rehs at gmx dot net
Description:
------------
PHP 5.5.7 (cli) (built: Dec 11 2013 20:55:14)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
Server version: Apache/2.2.25 (Unix)
Server built: Jul 18 2013 19:05:23
I have a problem with register_shutdown_function and headers_list and header.
My script rewrites some headers when register_shutdown_function is called.
Sometimes the script just crashes with a segmentation fault.
Test script:
---------------
I have not been able to write a short example but it tracked the issue down to
register_shutdown_fuction
Big Script:
https://github.com/Phhere/webSPELL-4.2.3/tree/modRewrite
Problem is in file src/modrewrite.php. If you comment out line 21 to 26 it works like expected
Actual result:
--------------
Program terminated with signal 11, Segmentation fault.
#0 0x00007f92753832cc in zend_call_function () from /etc/httpd/modules/libphp5.so
(gdb) backtrace
#0 0x00007f92753832cc in zend_call_function () from /etc/httpd/modules/libphp5.so
#1 0x00007f927533b619 in sapi_send_headers () from /etc/httpd/modules/libphp5.so
#2 0x00007f92752bb309 in php_header () from /etc/httpd/modules/libphp5.so
#3 0x00007f9275342f63 in ?? () from /etc/httpd/modules/libphp5.so
#4 0x00007f9275343ff5 in php_output_write () from /etc/httpd/modules/libphp5.so
#5 0x00007f9275347326 in php_output_end_all () from /etc/httpd/modules/libphp5.so
#6 0x00007f92753324e5 in php_request_shutdown () from /etc/httpd/modules/libphp5.so
#7 0x00007f92754432ef in ?? () from /etc/httpd/modules/libphp5.so
#8 0x00000000004375f0 in ap_run_handler ()
#9 0x00000000004379b9 in ap_invoke_handler ()
#10 0x0000000000443f38 in ap_process_request ()
#11 0x0000000000441580 in ?? ()
#12 0x000000000043da40 in ap_run_process_connection ()
#13 0x0000000000448a0f in ?? ()
#14 0x0000000000448e44 in ?? ()
#15 0x0000000000448ee6 in ?? ()
#16 0x0000000000449cc1 in ap_mpm_run ()
#17 0x00000000004239a6 in main ()
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66418&edit=1
Thread (3 messages)