php5-fastcgi causing core dumps?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

My web host added these lines to .htaccess to enable PHP processing inside HTML files

AddHandler php5-fastcgi .htm .html
Action php5-fastcgi /cgi-bin/php5.fcgi

(the standard methods did not work)

it works, however, this is causing two 30GB+ core dumps to appear in cgi-bin a few minutes after the page loads...

help Confused

the php code is one line that checks if a cookie and a session variable are set, and if both are missing it echoes a line of JavaScript to change the location... (I had header issues, decided JS was easier)

<html>
<head>
  <title> AGE VERIFIED </title>
</head>

<body>
<H1>AGE VERIFIED</H1>

<!-- add this line to every page -->
<?php if (!isset($_COOKIE["age"]) && !isset($_SESSION['age'])) echo "<script>location='verify.htm'</script>"; ?>

</body>
</html>

full .htaccess:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
Options All
DirectoryIndex index.htm index.html index.php

AddHandler php5-fastcgi .htm .html
Action php5-fastcgi /cgi-bin/php5.fcgi

#RewriteEngine on
#RewriteRule ^/?$ /index.htm [L]

I commented out RewriteRule and still works ok

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Core dumps usually happen when there is a segmentation fault which is caused by a program trying to access memory outside their allocated addresses. This can be caused by trying to read/write from a file pointer reference when that file failed to open or something. Does running your page case a core dump every time?...and are you sure this is the page that is causing it?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

it appears to be this file triggering it, without any of the additional processing.

when the cookie and session are not set, then an html page with some JavaScript is displayed...

the only other PHP code is this page that sets the dookie and session var if the birthdate validates, but this code is not even running at all, just the one line above...

might be related, how important is it to start (and stop?) the session? I want to use a session in case cookies are disabled.

heh - I just noticed I am using POST and REQUEST for the same value, odd butt should not matter.

<?php

//set redirect page URL
$page = "index.htm";

//init session false
$_SESSION['age']=false;
//get the hidden field from form to thwart bots
$check = $_POST['testform']? $_REQUEST['testform']:"";

//if form submitted, not a bot
if ($check == "cmscver0102"){
 
//set session var
 
$_SESSION['age']=true;
 
//expire cookie in 12 months
 
$expire=time()+(60*60*24*30*12);
 
setcookie("age", "yes", $expire);
 
header("Location: $page");
}

//else hello Mickey!
else header("Location: <a href="http://disney.com"" title="http://disney.com"">http://disney.com"</a>);
?>

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

well, I removed the age check files and uploaded a basic html file with the phpinfo() function embedded - and viewing this page, which displays phpinfo, also causes a core dump

http://decibelplaces.com/age_check/phpinfo.html

<html>
<head>
  <title> phpinfo() html </title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

.htaccess

# DirectoryIndex: sets the file that Apache will serve if a directory is requested.

Options All
DirectoryIndex index.htm index.html index.php

AddHandler php5-fastcgi .htm .html
Action php5-fastcgi /cgi-bin/php5.fcgi

#RewriteEngine on
#RewriteRule ^/?$ /index.htm [L]

here is the php5.fcgi

#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5

They have: 121 posts

Joined: Dec 2008

So the page completes successfully, with HTTP 200, etc, is logged in apache, sent to the client, and then core dumps?!

Cheers,
Shaggy

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

here is the log:

67.83.70.143 - - [18/Feb/2009:20:54:09 -0500] "GET /age_check/phpinfo.html HTTP/1.1" 200 70032 "http://decibelplaces.com/age_check/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.1;MEGAUPLOAD 1.0 FlyPaper/RC1 (.NET CLR 3.5.30729)"

I received notice this morning that the issue was escalated to Level 3 - but it is "Low Priority" because I do not need this functionality on this server now.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

PROBLEM SOLVED!!! Laugh

eaccelerator was causing it to core dump, so I put a php.ini file with the extension commented out in your directory.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.