Bug #67406 [NEW]: built-in web-server segfaults on startup
| From: | remi@php.net | Date: | Tue, 10 Jun 2014 08:15:23 +0000 |
| Subject: | Bug #67406 [NEW]: built-in web-server segfaults on startup | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186126@lists.php.net to get a copy of this message | ||
From: remi
Operating system: GNU/Linux (aarch64)
PHP version: 5.4.29
Package: Built-in web server
Bug Type: Bug
Bug description:built-in web-server segfaults on startup
Description:
------------
In php_cli_server, we use a static const struct timeval
According to select man page :
"(ii) select() may update the timeout argument to indicate how much
time was left."
Removing the "static const" solves this issue.
Test script:
---------------
$ gdb sapi/cli/php
(gdb) run -S 127.0.0.1:8000
Expected result:
----------------
PHP 5.5.13 Development Server started at Tue Jun 10 03:08:42 2014
Listening on http://127.0.0.1:8000
Document root is
/discer.farm/home/remote/rcollet/rpmbuild/BUILD/php-5.5.13
Press Ctrl-C to quit.
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
(gdb) bt
#0 0x000003ffb7cf23d4 in select () from /lib64/libc.so.6
#1 0x00000000006e96d4 in php_cli_server_poller_poll (poller=0x879668
<server+8>, tv=0x80c1a8 <tv.15150>) at
/home/remote/rcollet/rpmbuild/BUILD/php-5.5.13/sapi/cli/php_cli_server.c:901
#2 0x00000000006edfa0 in php_cli_server_do_event_loop (server=0x879660
<server>) at
/home/remote/rcollet/rpmbuild/BUILD/php-5.5.13/sapi/cli/php_cli_server.c:2480
#3 0x00000000006ee31c in do_cli_server (argc=3, argv=0x880f10) at
/home/remote/rcollet/rpmbuild/BUILD/php-5.5.13/sapi/cli/php_cli_server.c:2583
#4 0x00000000006e2dd0 in main (argc=3, argv=0x880f10) at
/home/remote/rcollet/rpmbuild/BUILD/php-5.5.13/sapi/cli/php_cli.c:1381
--
Edit bug report at https://bugs.php.net/bug.php?id=67406&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67406&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67406&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67406&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67406&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67406&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67406&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67406&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67406&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67406&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67406&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67406&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67406&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67406&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67406&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67406&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67406&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67406&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67406&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67406&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67406&r=mysqlcfg