Apache child process exited with status 255 - php

After lot of searching, trying, fixing, waiting and crying and before I give up, I want to take the last chance here for this bug...
We're running on Microsoft Windows Server 2012, Apache/2.4.6 (Win64) OpenSSL/1.0.1e PHP/5.5.1.
Periodically, at least 5-10 times within 24 hours, Apache crashing and restarting. Mostly twice. Because PHP crashed.
The whole application is PHP, so configuring php as FastCGI won't solve the problem: Apache will not crash but PHP will.
here some more info:
Windows Event Log:
Faulting application name: httpd.exe, version: 2.4.6.0, time stamp: 0x51e441d6
Faulting module name: php5ts.dll, version: 5.5.1.0, time stamp: 0x51e849b0
Exception code: 0xc0000005
Fault offset: 0x00000000000572d8
Faulting process id: 0xac0
Faulting application start time: 0x01d0a96634f3d129
Faulting application path: C:\Apache24\bin\httpd.exe
Faulting module path: C:\PHP\php5ts.dll
Report Id: 06409cc4-1568-11e5-93ff-d43d7edb03a9
Faulting package full name:
Faulting package-relative application ID:
Apache Log:
[Thu Jun 18 06:13:44.284810 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00428: Parent: child process 2752 exited with status 255 -- Restarting.
[Thu Jun 18 06:13:44.487977 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00455: Apache/2.4.6 (Win64) OpenSSL/1.0.1e PHP/5.5.1 configured -- resuming normal operations
[Thu Jun 18 06:13:44.487977 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00456: Apache Lounge VC11 Server built: Jul 15 2013 20:45:22
[Thu Jun 18 06:13:44.487977 2015] [core:notice] [pid 2736:tid 392] AH00094: Command line: 'c:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Thu Jun 18 06:13:44.487977 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00418: Parent: Created child process 4408
In PHP log nothing special and no pattern before crash.
Also concurrent connections not affecting the problem - it's happens even when we have very few users.
MySQL? But no errors pointing to this or I looking in wrong place?
Windows? How to figure out?
PHP/Apache configuration? Well, what else.. and why?
Aliens...
The main question is why PHP is crashing?..
Thanks in advance!

In my case, nothing more in logs.
Only:
Parent: child process XXXX exited with status 255 -- Restarting
Problem was in redirect code:
<?php
header('HTTP/1.1 304 Not Modified');
exit();
?>
This code stops apache service and start new processes.
But not all time... sometimes worked fine... sometimes crashes :(
Correct code is:
<?php
header('HTTP/1.1 304 Not Modified');
die();
?>
More informations about:
PHP: Utilizing exit(); or die(); after header("Location: ");

There is a known bug: Whenever a file you include has a filesize of 4096 or more the php module and apache will stopp working. Thats not a joke!

I think there are several different causes for this child process XYZ exited with status 255 on the net. Most of them are PHP related.
I just had the same crash on Windows, Apache 2.4.18 with PHP 5.6.16, when passing a users' post message through the Markdown parser from http://parsedown.org . Fixed it by surrounding SQL source code in the message which had backticks for identifier quotings, with the three backticks Markdown expects for source code. Did not dive deeper into Parsedown.php to find out where it exactly happened, but it must be something with these backticks.

Related

Windows server running APACHE crashing - CPU 100% - Drupal Website

I’ve been having a major issue with my Drupal website for the past couple of weeks. I’ve been trying to home in on where the issue is coming from but at the moment it has been hard to work out if it is module related or server related.
Essentially my server is hitting 100% CPU and doesn’t stop until I reset APACHE. I’m not getting the WSOD with a PHP error and there are no new entries in my PHP error log. Also, because PHP doesn’t give me an error I haven’t been able to use xhprof to debug.
I found that this would happen when I had multiple users browsing the website and also when I quickly opened multiple tabs in my browser. I had at first thought it was because I had some views embedded in a page using the views field module, each of which I had contextual filters enabled. These pages were usually where the issue would arise.
I have however been able to replicate the crash by quickly opening pages in multiple tabs where views aren’t present. This then started to make me think it was server related, but because I don’t have much experience in the server side of things I wasn’t sure what to look for or how to debug.
The details of my server and module setup are below. I’d appreciate any help or direction on this as it’s become a show stopper as far as launching our site is concerned.
- Server:Windows server 2012 – Intel Xeon 2.2GHz, 8GB RAM, 64-bit Operating System
- APACHE: Apache/2.2.25
- PHP: php-5.4.20-Win32-VC9-x86 - Memory limit 120M
- Database: Microsoft SQL Server 10.50.1600 (using sqlsrv module) located in a different server
- Drupal: 7.23
- Memcache: 3.0.7
- Modules that I thought could be linked to the issue (but might not be): views, entity reference, views field
The APACHE error log has the following entries when I replicate the crash:
- [Wed Mar 12 18:46:37 2014] [notice] Parent: child process exited with status 255 -- - Restarting.
- [Wed Mar 12 18:46:37 2014] [notice] Apache/2.2.25 (Win32) PHP/5.4.20 configured -- resuming normal operations
- [Wed Mar 12 18:46:37 2014] [notice] Server built: Jun 29 2013 19:23:21
- [Wed Mar 12 18:46:37 2014] [notice] Parent: Created child process 5084
- [Wed Mar 12 18:46:37 2014] [notice] Child 5084: Child process is running
- [Wed Mar 12 18:46:37 2014] [notice] Child 5084: Acquired the start mutex.
- [Wed Mar 12 18:46:37 2014] [notice] Child 5084: Starting 150 worker threads.
- [Wed Mar 12 18:46:37 2014] [notice] Child 5084: Starting thread to listen on port 80.
- [Wed Mar 12 18:46:37 2014] [notice] Child 5084: Starting thread to listen on port 80.
- [Wed Mar 12 18:46:41 2014] [notice] Parent: child process exited with status 255 -- Restarting.
- [Wed Mar 12 18:46:41 2014] [notice] Apache/2.2.25 (Win32) PHP/5.4.20 configured -- resuming normal operations
- [Wed Mar 12 18:46:41 2014] [notice] Server built: Jun 29 2013 19:23:21
- [Wed Mar 12 18:46:41 2014] [notice] Parent: Created child process 1628
- [Wed Mar 12 18:46:41 2014] [notice] Child 1628: Child process is running
- [Wed Mar 12 18:46:41 2014] [notice] Child 1628: Acquired the start mutex.
- [Wed Mar 12 18:46:41 2014] [notice] Child 1628: Starting 150 worker threads.
- [Wed Mar 12 18:46:41 2014] [notice] Child 1628: Starting thread to listen on port 80.
- [Wed Mar 12 18:46:41 2014] [notice] Child 1628: Starting thread to listen on port 80.
- [Wed Mar 12 18:51:33 2014] [notice] Parent: Received shutdown signal -- Shutting down the server.
- [Wed Mar 12 18:51:35 2014] [notice] Child 1628: Exit event signaled. Child process is ending.
- [Wed Mar 12 18:51:36 2014] [notice] Child 1628: Released the start mutex
- [Wed Mar 12 18:51:53 2014] [notice] Parent: Child process exited successfully.
The windows evernt log has the following:
- Faulting application name: httpd.exe, version: 2.2.25.0, time stamp: 0x51cf187f
- Faulting module name: php5ts.dll, version: 5.4.20.0, time stamp: 0x523a144e
- Exception code: 0xc0000005
- Fault offset: 0x0004b4dd
- Faulting process id: 0x65c
- Faulting application start time: 0x01cf3e2368a98606
- Faulting application path: C:\Apache2\bin\httpd.exe
- Faulting module path: C:\php-5.4.20-Win32-VC9-x86\php5ts.dll
- Report Id: a868e8ac-aa16-11e3-93f4-0050568b2e3b
- Faulting package full name:
- Faulting package-relative application ID:
Sorry about the amount of writing but I wanted to make sure I explained as much as I could.
Thanks

Apache error log: zend_mm_heap corrupted, child process exited with status 1 -- Restarting

I have seen some topics about 'zend_mm_heap' corrupted and 'child process exited with status nnnnn' but none of this topics lead to a solution. What does status 1 means in clear text, it is not clear what exactly happen.
Symptoms
This problem does not occur when the site is running without being logged in. Only when I logged in the problem sometimes happen when refreshing the page. Strange is that sometimes the html fails to load and sometimes resources like a CSS file or JS file. I also have seen that some resources take 6 seconds to 10 seconds to load. I think this is caused by restarting the server because of this error.
When above symptoms occur, the following (similar) info is written to the error.log file:
Error in error.log file:
zend_mm_heap corrupted
[Sun Feb 09 03:56:57 2014] [notice] AH00428: Parent: child process exited with status 1 -- Restarting.
[Sun Feb 09 03:56:57 2014] [notice] AH00455: Apache/2.4.3 (Win64) configured -- resuming normal operations
[Sun Feb 09 03:56:57 2014] [notice] AH00456: Server built: Aug 18 2012 14:13:48
[Sun Feb 09 03:56:57 2014] [notice] AH00418: Parent: Created child process 3460
[Sun Feb 09 03:56:57 2014] [notice] AH00354: Child: Starting 64 worker threads.
Configuration:
Intel I7 (Quadcore) chipset, 16GB RAM
Running latest XAMMP (or Z-WAMP, in both the same problem - see for Z-WAMP also http://zwamp.sourceforge.net/) on Windows 7 64 bit
Running APC -
For example:
Normal feedback (when problem does not occur):
What I want to know
Does have somebody info about Apache status 1 exit?
Am I able to debug this, how can I debug this?
There is a problem with APC (I use version 1.3.1) that cause this error, corrupt memory for some reason. I believe it has something do with session data because the problems only occur when logged in. My PHP class uses only a session when it is required to be logged in to be able to view the page. I have also checked my code but there is nothing abnormal or incomplete.
When I turn off the Windows extension php_apc.dll in the php.ini file everthing is working fine. No memory corruption and no delays. Also tried other cache extensions like xCache, eAccelerator, memcache and loads normally.
So I qualify this as a bug.

APACHE Crashing: Parent: child process exited with status 3221225477 -- Restarting

My following setup is Xampp 1.7.7 and here is the info for everything in that package:
- Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
I'm running the server on Windows XP SP3 32 bit OS, 4 gigs of ram, Quad Core.
The issue I'm having in my apache error log file is:
[Tue Apr 24 15:55:55 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Tue Apr 24 15:55:57 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Apr 24 15:55:57 2012] [notice] Digest: done
[Tue Apr 24 15:55:59 2012] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Apr 24 15:55:59 2012] [notice] Server built: Sep 10 2011 11:34:11
[Tue Apr 24 15:55:59 2012] [notice] Parent: Created child process 776
[Tue Apr 24 15:56:00 2012] [notice] Disabled use of AcceptEx() WinSock2 API
[Tue Apr 24 15:56:01 2012] [notice] Digest: generating secret for digest authentication ...
[Tue Apr 24 15:56:01 2012] [notice] Digest: done
[Tue Apr 24 15:56:02 2012] [notice] Child 776: Child process is running
[Tue Apr 24 15:56:02 2012] [notice] Child 776: Acquired the start mutex.
[Tue Apr 24 15:56:02 2012] [notice] Child 776: Starting 350 worker threads.
[Tue Apr 24 15:56:02 2012] [notice] Child 776: Listening on port 443.
[Tue Apr 24 15:56:02 2012] [notice] Child 776: Listening on port 80.
This seems to occur sporadically throughout the day and I even tried using Win32DisableEx, EnableIMAP Off and EnableSendFile Off in the apache conf file. I also tried copying the libmysql.dll file to the system32 and apache/bin folders with no avail.
If anyone knows other reasons this error for the child process exiting and causing apache to crash, info would be greatly appreciated. If any additional log files are needed please let me know.
Tks,
Shane.
The error code 3221225477 is 0xC0000005 in hex, which on Windows is:
#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L)
Access violation is Windows' version of "segmentation fault", which simply said means that the program tried to access a memory which is not allocated. This can happen for a lot of different reasons, but mostly (if not always) is a bug in the program.
Now, my guess for your situation, is that there is either a bug in PHP or in one of PHP's extensions or in Perl or some Perl application. Apache itself is usually very stable, but if you use some unusual extension, it might be the cause, too.
I would suggest updating all your configuration to latest versions. If you want to find the source of the problem for sure, run Apache inside a debugger, like Visual Studio or OllyDbg. When the exception (access violation) happens, it will stop execution (instead of restarting) and you'll see in which module it is.
Also take a look in the access log, if there is a suspicious request with the same timestamp as the error. But it may happen that the crash happens before the request is saved in the logfile.

The infamous Apache error "Parent: child process exited with status 3221225477"

I've read some questions and responses related to the infamous Apache error
Apache error [notice] Parent: child process exited with status 3221225477 — Restarting
But nothing could help me so far. What I'm asking to you is if I used a Linux version, could the script crash Apache for the same reason?
By the way if anyone has any suggestion for my case here is Apache's error.log
[Mon Aug 08 14:31:44 2011] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Mon Aug 08 14:31:44 2011] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Mon Aug 08 14:31:44 2011] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Mon Aug 08 14:31:44 2011] [notice] Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_autoindex_color PHP/5.1.6 configured -- resuming normal operations
[Mon Aug 08 14:31:44 2011] [notice] Server built: Aug 13 2006 19:16:43
[Mon Aug 08 14:31:44 2011] [notice] Parent: Created child process 4364
[Mon Aug 08 14:31:45 2011] [notice] Child 4364: Child process is running
[Mon Aug 08 14:31:45 2011] [notice] Child 4364: Acquired the start mutex.
[Mon Aug 08 14:31:45 2011] [notice] Child 4364: Starting 250 worker threads.
[Mon Aug 08 14:31:45 2011] [notice] Child 4364: Starting thread to listen on port 8088.
[Mon Aug 08 14:31:45 2011] [notice] Child 4364: Starting thread to listen on port 8086.
I can't understand why moving dlls around the filesystem solve most problems and all the suggestions in the related questions which were about moving libraries didn't work for me.
I'm running an old XAMPP release with PHP 5.1.6 (XAMPP for Windows 1.5.4) and working with Doctrine ORM (Yes, I'm aware that Doctrine requires PHP 5.2.3+).
I've just had this same problem on a WAMP installation. I tracked it down to a bit of my own rubbish code. I had a method calling itself.
Here's an example:-
<?php
echo "Welcome to stupid class!";
class stupid_class {
public $example_data;
function stupid_function($Data) {
self::stupid_function($Data);
if($Data=="Hello") return true;
else die("Incorrect data passed through.".$Data."<br />");
}
}
$myClass = new stupid_class();
$myvalue = $myClass->stupid_function("Hello");
?>
I know this is hardly an ideal example of great code, (it was actually a typo) but I would have expected there to be some error thrown before getting a 'connection was reset' message.
So I guess an answer would be, check through all your methods to make sure that you're not calling one infinitely.
I hope this helps someone to figure out why this is happening in PHP, Apache.
Cheers
Tee
In my case it was the php extension APC (php_apc.dll, 3.1.10-5.4-vc9-x86, threadsafe), which caused the error.
I used XAMPP 1.8.2 with PHP 5.4.19 and Apache 2.4.4
Since it could be caused by another extension as well, it might be a good starting point to restore the original php.ini from the xampp distribution. If this one works well, try to change it line by line to your desired configuration (starting with the extension list).

How do I debug errors that have no error message?

How do I debug errors that have no error message?
When loading a PHP page I am getting this error in Firefox.
The connection to the server was reset while the page was loading.
It gives no indication as to why other than it appears to be Apache crashing.
Apache error logs shows:
[Wed Nov 03 10:23:04 2010] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Wed Nov 03 10:23:06 2010] [notice] Digest: generating secret for digest authentication ...
[Wed Nov 03 10:23:06 2010] [notice] Digest: done
[Wed Nov 03 10:23:06 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Nov 03 10:23:06 2010] [notice] Server built: Nov 11 2009 14:29:03
[Wed Nov 03 10:23:06 2010] [notice] Parent: Created child process 5100
[Wed Nov 03 10:23:07 2010] [notice] Digest: generating secret for digest authentication ...
[Wed Nov 03 10:23:07 2010] [notice] Digest: done
[Wed Nov 03 10:23:07 2010] [notice] Child 5100: Child process is running
[Wed Nov 03 10:23:07 2010] [notice] Child 5100: Acquired the start mutex.
[Wed Nov 03 10:23:07 2010] [notice] Child 5100: Starting 150 worker threads.
[Wed Nov 03 10:23:07 2010] [notice] Child 5100: Starting thread to listen on port 80.
[Wed Nov 03 10:23:07 2010] [notice] Child 5100: Starting thread to listen on port 80.
I tried searching the 3221225477 code but found nothing that worked.
Also the Windows Event Viewer shows this:
Faulting application name: httpd.exe, version: 2.2.14.0, time stamp: 0x4aeb9704
Faulting module name: php5ts.dll, version: 5.3.1.0, time stamp: 0x4b06c41d
Exception code: 0xc0000005
Fault offset: 0x00082391
Faulting process id: 0x8f4
Faulting application start time: 0x01cb7b85fa74bf83
Faulting application path: C:\xampp\apache\bin\httpd.exe
Faulting module path: C:\xampp\php\php5ts.dll
Report Id: 73996201-e779-11df-938f-e0cb4e5b154a
This is happening when I call:
return mysql_fetch_object($result, $class_name);
Its also happening on another page when I use $_SESSION
If I switch to using CGI instead of the php5ts.dll and php5apache2_2.dll I get:
Premature end of script headers: php-cgi.exe
Its is only happening for some pages. Others work fine.
No PHP errors or exceptions occur. Error reporting is set to E_ALL & ~E_NOTICE & ~E_DEPRECATED. display_errors is on.
Timeout is set to 60 seconds, the error page is returned in about 10 seconds.
The memory usage gets about 16MB, the maximum limit is 256MB.
PHP 5.3.1, Windows 7 64bit.
So does anyone know how to effectively debug this error?
Well, you can start by reading "Generating a Backtrace" and searching for registered PHP bug reports similar to you, and submitting a bug if you've really found none. If you are really interested, you can inspect the PHP Source and propose a patch.
Looks like you are experiencing a bug in PHP, leading to a crash. Try to upgrade to the latest nightly build (http://snaps.php.net/). If that doesn't help, try to get a backtrace and submit a bug on bugs.php.net.
Seems that the script is taking a long time to execute so the browser is timing out. try using the php function set_time_limit to keep the script from dying.
set_time_limit(0); // no time limit
If apache is crashing it may be due to a mangled .htaccess. Is there any log entry before the error message/crash to indicate what Apache thought it was doing?
Upgrade your PHP.
(This is what I did, and now it seems to work, however my question still stands: How do I effectively debug issues like these?)
http://bugs.php.net/bugs-getting-valgrind-log.php
[edit2]
http://en.wikipedia.org/wiki/Strace can also be handy to find the spot that takes you system down.
[edit]
how did you monitor the memory usage?

Categories