Bug #66375 [Ver->Csd]: Embedded Server segfault with header_register_callback
| From: | krakjoe@php.net | Date: | Wed, 01 Jan 2014 13:02:11 +0000 |
| Subject: | Bug #66375 [Ver->Csd]: Embedded Server segfault with header_register_callback | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183532@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66375&edit=1
ID: 66375
Updated by: krakjoe@php.net
Reported by: gmblar+php at gmail dot com
Summary: Embedded Server segfault with
header_register_callback
-Status: Verified
+Status: Closed
Type: Bug
Package: *General Issues
Operating System: MacOSX 10.9.1
PHP Version: 5.5.7
Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of joe.watkins@live.co.uk
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3c3ff434329d2f505b00a79bacfdef95ca96f0d2
Log: fix #66375 bad logic in sapi header callback routine
Previous Comments:
------------------------------------------------------------------------
[2013-12-31 19:16:30] krakjoe@php.net
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
------------------------------------------------------------------------
[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