Bug #66375 [PATCH]: Embedded Server segfault with header_register_callback
Edit report at https://bugs.php.net/bug.php?id=66375&edit=1
ID: 66375
Patch added by: krakjoe@php.net
Reported by: gmblar+php at gmail dot com
Summary: Embedded Server segfault with
header_register_callback
Status: Open
Type: Bug
Package: *General Issues
Operating System: MacOSX 10.9.1
PHP Version: 5.5.7
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: register_header_callback_segfault.patch
Revision: 1388517390
URL: https://bugs.php.net/patch-display.php?bug=66375&patch=register_header_callback_segfault.patch&revision=1388517390
Previous Comments:
------------------------------------------------------------------------
[2013-12-31 11:45:23] gmblar+php at gmail dot com
Description:
------------
Embedded server segfault when callback for header_register_callback is a method.
1. Create script.
2. Start embedded server with php -S 0.0.0.0:8080.
3. First curl request curl http://localhost:8080/foo
succeed.
4. Second curl request (only when path differs!) curl http://localhost:8080/foobar fails.
Test script:
---------------
<?php
class Foo {
public function __construct() {
header_register_callback(array($this, 'headerCallback'));
}
public function headerCallback() {
}
}
$foo = new Foo();
Expected result:
----------------
PHP 5.5.7 Development Server started at Tue Dec 31 12:40:41 2013
Listening on http://0.0.0.0:8080
Document root is /Users/Username/Sites/Projectname/Public
Press Ctrl-C to quit.
[Tue Dec 31 12:41:27 2013] 127.0.0.1:54151 [200]: /foo
[Tue Dec 31 12:41:27 2013] 127.0.0.1:54154 [200]: /foobar
Actual result:
--------------
PHP 5.5.7 Development Server started at Tue Dec 31 12:39:09 2013
Listening on http://0.0.0.0:8080
Document root is /Users/Username/Sites/Projectname/Public
Press Ctrl-C to quit.
[Tue Dec 31 12:40:39 2013] 127.0.0.1:54136 [200]: /foo
[Tue Dec 31 12:40:41 2013] 127.0.0.1:54139 [200]: /foobar
Segmentation fault: 11
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66375&edit=1
Thread (4 messages)