php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6058 Processes not dying
Submitted: 2000-08-10 01:48 UTC Modified: 2000-12-07 11:27 UTC
From: mstelzer at ea dot com Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.0.0 OS: Win NT4 SP6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mstelzer at ea dot com
New email:
PHP Version: OS:

 

 [2000-08-10 01:48 UTC] mstelzer at ea dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-01 11:11 UTC] sniper@php.net
1. Shorten you example scripts to minimum.
2. Try php4.0.3pl1 or php4.0.4-dev from http://php4win.de

--Jani
 [2000-12-07 11:27 UTC] sniper@php.net
No feedback.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Dec 03 22:03:34 2021 UTC