#48592 [NEW]: Missing environment variables in CGI SAPI crashes on startup
| From: | gwynne@php.net | Date: | Thu, 18 Jun 2009 05:29:06 +0000 |
| Subject: | #48592 [NEW]: Missing environment variables in CGI SAPI crashes on startup | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-138437@lists.php.net to get a copy of this message | ||
From: gwynne@php.net
Operating system: Darwin9 (MacOS X 10.5)
PHP version: 5.3CVS-2009-06-18 (CVS)
PHP Bug Type: Reproducible crash
Bug description: Missing environment variables in CGI SAPI crashes on startup
Description:
------------
If certain environment variables are missing, with others present, when
the CGI SAPI is called, it will crash early on with a NULL pointer
dereference.
Reproduce code:
---------------
bash$ SERVER_NAME=anything SERVER_PORT=80 REDIRECT_STATUS=200 php-cgi
Expected result:
----------------
<a message about no input file, or waiting for input on STDIN>
Actual result:
--------------
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x90be0f30 in strlen ()
(gdb) bt
#0 0x90be0f30 in strlen ()
#1 0x00323dd3 in php_fopen_primary_script (file_handle=0xbfffea6c,
tsrm_ls=0xf01a80) at cvs/php-5.3/main/fopen_wrappers.c:454
#2 0x0049bcb2 in main (argc=1, argv=0xbfffeb58) at
cvs/php-5.3/sapi/cgi/cgi_main.c:1999
--
Edit bug report at http://bugs.php.net/?id=48592&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48592&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48592&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48592&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48592&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48592&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48592&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48592&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48592&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48592&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48592&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48592&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48592&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48592&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48592&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48592&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48592&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48592&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48592&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48592&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48592&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48592&r=mysqlcfg