Bug #66418 [NEW]: Segmentation fault while sending headers
From: P dot Rehs at gmx dot net
Operating system: Linux
PHP version: 5.5.7
Package: HTTP related
Bug Type: Bug
Bug description:Segmentation fault while sending headers
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 bug report at https://bugs.php.net/bug.php?id=66418&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66418&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66418&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66418&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66418&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66418&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66418&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66418&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66418&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66418&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66418&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66418&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66418&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66418&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66418&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66418&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66418&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66418&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66418&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66418&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66418&r=mysqlcfg
Thread (3 messages)
- P dot Rehs at gmx dot net