PHP 4.0 Bug #3213: odbc_close with bad connection ID causes server to hang
| From: | phil at dialsolutions dot co dot uk | Date: | Fri, 14 Jan 2000 11:50:54 +0000 |
| Subject: | PHP 4.0 Bug #3213: odbc_close with bad connection ID causes server to hang | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14616@lists.php.net to get a copy of this message | ||
From: phil@dialsolutions.co.uk
Operating system: NT4 SP4 IIS4
PHP version: 4.0 Beta 3
PHP Bug Type: ODBC related
Bug description: odbc_close with bad connection ID causes server to hang
I'm using the downloaded ISAPI binary of php4.0b3 on NT4 SP4 with IIS4.
Having just converted a script from odbc calls to use direct mysql calls, I had a problem with IIS
hanging. I had forgotten to remove one odbc_close call, and was passing the connection id from
mysql_connect to the odbc_close call.
php generated a suitable warning message:
Warning: Supplied resource is not a valid ODBC-Link resource in f:\php\nyorks\mysql\index.php on
line 107
but then server ourput to the browser stalled.
The index.php file was left open, and I was unable to stop the server using 'net stop
iisadmin'
After a reboot, subsequent attempts to reproduce the problem no longer caused the server to hang,
but after the output page was displayed, the index.php file remained open until the server was
stopped using net stop iisadmin (which now works ok).
I realise that is my own stupid fault for having the faulty odbc_close in the script, but php
probably ought to react more kindly to the error.
The following script is sufficient to show the problem.
<?php
$db=mysql_connect();
if(!$db)
{
die("dead");
}
odbc_close($db);
?>