|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22229 binding (-b) fastcgi produces a segfault
Submitted: 2003-02-14 20:41 UTC Modified: 2003-02-15 11:02 UTC
From: grigorig at web dot de Assigned:
Status: Closed Package: Other web server
PHP Version: 4CVS-2003-02-14 (stable) OS: FreeBSD 4.7-RELEASE-p1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: grigorig at web dot de
New email:
PHP Version: OS:


 [2003-02-14 20:41 UTC] grigorig at web dot de
CFLAGS=-g ./configure --enable-fastcgi

cd sapi/cgi

./php -b 1234
zsh: 35201 segmentation fault (core dumped)  ./php -b 1234

this shouldn't be.

gdb ./php
GNU gdb 4.18 (FreeBSD)
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 2627 in elfstab_build_psymtabs
Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 933 in fill_symbuf

(gdb) run -b 1234
Starting program: /usr/home/greg/sources/apache/php4-STABLE-200302150030/sapi/cgi/./php -b 1234

Program received signal SIGSEGV, Segmentation fault.
0x2823f5b0 in strdup () from /usr/lib/
(gdb) bt
#0  0x2823f5b0 in strdup () from /usr/lib/
#1  0x8159f40 in main (argc=3, argv=0xbfbffb0c)
    at /usr/home/greg/sources/apache/php4-STABLE-200302150030/sapi/cgi/cgi_main.c:976
#2  0x8060c51 in _start ()

line 976 says:
if (!fastcgi) bindpath= strdup(ap_php_optarg);

with my poor c knowledge I don't know what wrong.
But some lines above is a similar construct:
cgi_sapi_module.php_ini_path_override = strdup(ap_php_optarg);



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-15 06:05 UTC] grigorig at web dot de
same behaviour on debian testing / i386
 [2003-02-15 11:02 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 03:01:28 2024 UTC