php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45786 FastCGI process exited unexpectedly
Submitted: 2008-08-11 13:48 UTC Modified: 2011-05-02 21:05 UTC
From: karelevzen at gmail dot com Assigned: dmitry
Status: Closed Package: CGI/CLI related
PHP Version: 5.3CVS-2008-08-10 (CVS) OS: Windows Vista Ultimate x64 SP1
Private report: No CVE-ID:
 [2008-08-11 13:48 UTC] karelevzen at gmail dot com
Description:
------------
When you run PHP as a FastCGI module under IIS 7.0 (Windows Vista Ultimate x64) you get an error "FastCGI process exited unexpectedly" every time you visit a PHP page.

The page contents loads OK, but after a second or so you get this error (a GUI message). Until you receive the message, the browser seems to be loading something (this could mean that the request wasn't handled well).

Also, I've noticed that I have Configuration File (php.ini) set to C:\Windows, while the file is correctly loaded from C:\bin32\php\php.ini

Everything works OK with the 2.5.6 nts build.

Reproduce code:
---------------
<?php
  phpinfo();
?>

Expected result:
----------------
No error message.

Actual result:
--------------
Faulting module name: php-cgi.exe
Exception code: c0000005
Exception offset: 00005604

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-11 16:49 UTC] karelevzen at gmail dot com
may be related to bug 45630
 [2008-08-12 14:26 UTC] jani@php.net
You're propably loading some shared extensions in your php.ini? Disable all of them and try again. Then enable them one by one to find out the error causing one. Then check that the extension in question isn't compiled in the PHP core binary. (php -m output!)
 [2008-08-12 14:41 UTC] karelevzen at gmail dot com
I am not loading any extensions. It's a fresh install with recommended php.ini and only these changes:
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
and correct extension_dir
As I said, I've got all the extensions commented out.
 [2008-08-12 14:46 UTC] jani@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2008-08-12 20:51 UTC] karelevzen at gmail dot com
It tells me that it was not able to locate debug symbols, so I hope you find everything you need in this report. (I run it twice with the same results.)

Entry point   php_cgi+5ed6 
Create time   12.8.2008 22:45:19 
Time spent in user mode   0 Days 0:0:0.15 
Time spent in kernel mode   0 Days 0:0:0.31 

Function     Arg 1     Arg 2     Arg 3   Source 
php_cgi+5604     00000000     01452638     00c0ddcc    
php5ts!zend_hash_destroy+27     00000000     00000000     00000000    

PHP_CGI+5604WARNING - DebugDiag was not able to locate debug symbols for php-cgi.exe, so the information below may be incomplete.

In php-cgi__PID__5468__Date__08_12_2008__Time_10_45_29PM__791__Second_Chance_Exception_C0000005.dmp the assembly instruction at php_cgi+5604 in C:\Program Files (x86)\php\php-cgi.exe from The PHP Group has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 0
 [2008-08-13 01:05 UTC] jani@php.net
Well, you propably should install the debug symbols then? They can be found at same place as the snapshots..
 [2008-08-13 06:28 UTC] karelevzen at gmail dot com
I did that.I've downloaded the debug pack, unpacked it to: C:\Users\karel_evzen\Desktop\php-dbg and set the Symbol search path for analysis option in Debug Diagnostic Tool to: C:\Users\karel_evzen\Desktop\php-dbg
Yet I get the symbols not found warning. Am I missing something?
The debug pack contains runnable PHP, no pdb files. I cant find pdb files for the current 5.3 snapshot. Try it yourself.
 [2008-08-13 10:32 UTC] karelevzen at gmail dot com
So hey, I managed to find a 5.3 release WITH debug files at http://downloads.php.net/pierre/ ! Here is the complete bugtrace.

php_cgi!fcgi_free_var+4     00000000     001b2638     00c0ddcc    
php5ts!zend_hash_destroy+27     00c0fe00     00000010     00000001    
php_cgi!fcgi_finish_request+2f     00c0ddcc     001b2638     001b2708    
php_cgi!fcgi_accept_request+17     00c0ddcc     00000000     00000000    
php_cgi!main+69f     00000001     001b2638     001b1690    
php_cgi!mainCRTStartup+e3     7efde000     00c0ffd4     7752cfed    
kernel32!BaseThreadInitThunk+e     7efde000     7770f651     00000000    
ntdll!__RtlUserThreadStart+23     00405ed6     7efde000     00000000    
ntdll!_RtlUserThreadStart+1b     00405ed6     7efde000     00000000    




PHP_CGI!FCGI_FREE_VAR+4In php-cgi__PID__4064__Date__08_13_2008__Time_12_29_14PM__838__Second_Chance_Exception_C0000005.dmp the assembly instruction at php_cgi!fcgi_free_var+4 in C:\Program Files (x86)\php\php-cgi.exe from The PHP Group has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 0
 [2008-08-13 14:22 UTC] jani@php.net
Dmitry, something fishy with request shutdown in fastcgi? Note the ini options used by the user:

cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1

 [2008-08-18 11:03 UTC] dmitry@php.net
Could you please retest CVS.
 [2008-08-18 15:58 UTC] karelevzen at gmail dot com
No succes, sorry.
It behaves the same, eg. it loads the content, then keeps "loading" for some time (faulty php module). This time, the GUI error message DOES NOT APPER, but when I hit refresh, it displays a IIS error message stating:

HTTP Error 500.0 - Internal Server Error
Module	FastCgiModule
Notification	ExecuteRequestHandler
Handler	PHP
Error Code	0x8007000d

After another refresh the page again loads, keeps on loading for a while, than, after another refresh the same error appears.

IMHO it's the same problem, but this time IIS realizes that an error had occured when the second request is received.

Due to the GUI error not showing, I cannot send you a crushdump.
 [2008-08-18 18:45 UTC] karelevzen at gmail dot com
If this helps, I have created a dump 6 seconds after executing the page.
Thread 0:
ntdll!NtDelayExecution+15    
kernel32!SleepEx+62    
kernel32!Sleep+f    
php5ts!php_get_inf+1eaf    
php5ts!execute+cc5    
php5ts!execute+6130 

Thread 1:
user32!NtUserGetMessage+15    
user32!GetMessageA+a2    
php5ts!zend_timeout+1a8

Another thing I found interesting is, that upon the request, a php-cgi.exe is created and does nothing. After the timeout, in the same exact moment, a new php-cgi.exe is created, the old php-cgi.exe is destroyed and the page is rendered. Is this behaviour normal or should I futher investigate this strange process?

This second php-cgi.exe process is destroyed upon refresh and the display of the IIS error message.
 [2008-08-26 09:59 UTC] dmitry@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-04-12 19:11 UTC] differentpk at gmail dot com
I had the same problem like error 500, I set all extentions off and the problem was gone. Then i uncommented extentions one by one and found that the problems occures at ;extension=php_exif.dll. Though i removed the error message but i am still unable to find the solution yet.
 [2010-04-12 19:36 UTC] pajoye@php.net
Did you enable mbstring as well? And put it before exif in the list? Exif requires mbstring.

However that's unrelated to this bug, please ask for support on the PHP windows mailing list (or any other support channel).
 [2010-04-22 06:43 UTC] sejo at iteontech dot com
After debugging IIS and a bunch of other crazy things, this is what worked for me. I have PHP 5.3.2 on Windows 7 and IIS 7.
Try to execute PHP-CGI.EXE (BY DOUBLECLICKING ON IT). See if you get any error messages/ pop-ups. I got a ton of them and it all boiled down on having a bunch of extensions turned on, but not being available in my ext folder. Clear the PHP.INI of those invalid extensions and the problem should go away.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 23:01:58 2014 UTC