#23669 [Ver->Csd]: Segmentation fault occurs when calling PHP CGI as directory index
| From: | moriyoshi@php.net | Date: | Sat, 17 May 2003 18:57:28 +0000 |
| Subject: | #23669 [Ver->Csd]: Segmentation fault occurs when calling PHP CGI as directory index | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39850@lists.php.net to get a copy of this message | ||
ID: 23669
Updated by: moriyoshi@php.net
Reported By: m5issige at mr dot hitachi-medical dot co dot jp
-Status: Verified
+Status: Closed
Bug Type: CGI related
Operating System: SunOS 5.6
PHP Version: 4.3.2RC3
New Comment:
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 http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-05-17 03:47:56] moriyoshi@php.net
I can replicate the problem with the following shell script:
#!/bin/sh
REDIRECT_STATUS=200
REDIRECT_URL=/
REQUEST_METHOD=GET
REQUEST_URI=/
SCRIPT_FILENAME=blah
SCRIPT_NAME=/index.cgi
QUERY_STRING=
export REDIRECT_STATUS REDIRECT_URL REQUEST_METHOD REQUEST_URI
PATH_TRANSLATED PATH_INFO SCRIPT_FILENAME SCRIPT_NAME QUERY_STRING
gdb sapi/cgi/php
------------------------------------------------------------------------
[2003-05-17 00:31:21] m5issige at mr dot hitachi-medical dot co dot jp
When calling PHP script as directory index, it will be terminated with
segment fault in file cgi_main.c at line 709.
sapi/cgi/cgi_main.c:
708 if (stat( script_path_translated, &st ) == -1 ) {
709 char *pt = estrdup(script_path_translated);
710 int len = strlen(pt);
711 char *ptr;
Test script:
<?php phpinfo(); ?>
Apatch setting (in .htaccess):
DirectoryIndex index.cgi index.html
Then, access to
http://myhost.example.com/path/to/parent/directory/of/the/script/
Environment:
SunOS 5.6 with Apache 1.2.4 (yep, very old...)
Configure:
--prefix=$HOME --disable-cli
--disable-all --without-mysql --enable-safe-mode
--with-pcre-regex --with-regex=php --enable-mbstring
--enable-mbregex --enable-zend-multibyte --enable-fastcgi
--enable-session
(I can not swith to root, so I install PHP into my own directory)
Osamu Shigematsu
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23669&edit=1