PHP 4.0 Bug #6058: Processes not dying
| From: | mstelzer at ea dot com | Date: | Thu, 10 Aug 2000 05:48:45 +0000 |
| Subject: | PHP 4.0 Bug #6058: Processes not dying | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28296@lists.php.net to get a copy of this message | ||
From: mstelzer@ea.com
Operating system: Win NT4 SP6
PHP version: 4.0.0
PHP Bug Type: Other
Bug description: Processes not dying
Here's small script that allows to machine to post stats from a game to a database with
verification (keep reading...): [SOME PASSWORD INFO REMOVED]
<?
mssql_connect("", "", "");
// Client: just insert the stats into the pending table
if ($host == 0)
{
mssql_query("insert into pending_halfinnings(gid, inning, team, runs)
values('$gid', '$inning',
'$team', '$runs')");
}
// Host: wait for client's data to be entered, validate it, move it to the halfinnings table
else
{
$num = 0;
$starttime = time();
while ($num == 0)
{
$result = mssql_query("select runs
from pending_halfinnings
where gid='$gid'
and inning='$inning'
and team='$team'");
$num = mssql_num_rows($result);
// Timeout after 60 seconds of waiting for the client's post
if ((time() - $starttime) >= 60)
break;
}
mssql_query("delete from pending_halfinnings where gid='$gid'");
$arr = mssql_fetch_row($result);
if ($runs == $arr[0])
mssql_query("insert into halfinnings (gid, inning, team, runs)
values('$gid', '$inning',
'$team', '$runs')");
}
?>
Now the queries get more complicated...
<?
mssql_connect("slammer", "tripleplay", "easd");
// Client: just insert the stats into the pending table
if ($host == 0)
{
mssql_query("insert into
pending_pogs(gid, pog, singles, doubles, triples, homeruns,
rbis, stolenbases, runsscored, wins,
saves, complete, nohitter, strikeouts)
values('$gid', '$pog', '$singles',
'$doubles', '$triples', '$homeruns',
'$rbis', '$stolenbases', '$runsscored',
'$wins',
'$saves', '$complete', '$nohitter',
'$strikeouts')");
}
// Host: wait for client's data to be entered, validate it, move it to the halfinnings table
else
{
$num = 0;
$starttime = time();
while ($num == 0)
{
$result = mssql_query("select *
from pending_pogs
where gid='$gid'");
$num = mssql_num_rows($result);
// Timeout after 60 seconds of waiting for the client's post
if ((time() - $starttime) >= 60)
break;
}
mssql_query("delete from pending_pogs where gid='$gid'");
$arr = mssql_fetch_row($result);
if (($arr[1] == $pog) &&
($arr[2] == $singles) &&
($arr[3] == $doubles) &&
($arr[4] == $triples) &&
($arr[5] == $homeruns) &&
($arr[6] == $rbis) &&
($arr[7] == $stolenbases) &&
($arr[8] == $runsscored) &&
($arr[9] == $wins) &&
($arr[10] == $saves) &&
($arr[11] == $complete) &&
($arr[12] == $nohitter) &&
($arr[13] == $strikeouts))
{
mssql_query("insert into
pogs (gid, pog, singles, doubles, triples, homeruns,
rbis, stolenbases, runsscored, wins,
saves, complete, nohitter, strikeouts)
values('$gid', '$pog', '$singles',
'$doubles', '$triples', '$homeruns',
'$rbis', '$stolenbases', '$runsscored',
'$wins',
'$saves', '$complete', '$nohitter',
'$strikeouts')");
}
}
?>
In this second script when the main if...else statement goes into the ELSE, the script executes
completely, but the php.exe process fails to die. Once 10 of these processes build up, PHP stops
responding. This is on PHP4 pl2 with MSSQL 7.0
The first script runs fine, only the more complex second script does this. Please let me know what
you can about this problem.
Thanks,
Matt Stelzer
Software Engineer
Electronic Arts
mstelzer@ea.com