ID: 14886
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Summary: Access Violation in error handler with PEAR DB (ISAPI)
Status: Open
Bug Type: IIS related
Operating System: Win2000
PHP Version: 4.1.1
New Comment:
I have simplified the crash to the following script (note that $obj is
null). The bug does not happen when $testmysql = false.
<?php
error_reporting(E_ALL);
$testmysql = true;
print "<br>test start";
if ($testmysql) {
$conn = mysql_connect('localhost','root');
}
$obj->run();
print "<br>test end";
?>
I had to run "ab -n20000 -c10 <url>" several times before problems
started to occur on a W2k IIS server receiving no other visitors and had
just been restarted.
This is ApacheBench, Version 1.3c <$Revision: 1.45 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/
Copyright (c) 1998-2000 The Apache Group, http://www.apache.org/
Server Software: Microsoft-IIS/5.0
Server Hostname: jaguar
Server Port: 80
Document Path: /php/err.php
Document Length: 145 bytes
Concurrency Level: 10
Time taken for tests: 184.950 seconds
Complete requests: 20000
Failed requests: 556
(Connect: 0, Length: 556, Exceptions: 0)
Non-2xx responses: 555
Total transferred: 5504927 bytes
HTML transferred: 2847858 bytes
Requests per second: 108.14
Transfer rate: 29.76 kb/s received
Connnection Times (ms)
min avg max
Connect: 0 0 22
Processing: 4 90 466
Total: 4 90 488
Previous Comments:
------------------------------------------------------------------------
[2002-01-06 06:15:53] [EMAIL PROTECTED]
I ran ApacheBench on a PEAR DB script (see below), and IIS (ISAPI mode)
will die eventually. It is so bad that often "iisreset" is unable to
restart IIS.
The ab command I used:
ab -n10000 -c10 <url>
with the following results:
This is ApacheBench, Version 1.3c <$Revision: 1.45 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/
Copyright (c) 1998-2000 The Apache Group, http://www.apache.org/
Server Software: Microsoft-IIS/5.0
Server Hostname: jaguar
Server Port: 80
Document Path: /lens/adodb/peartest.php
Document Length: 142 bytes
Concurrency Level: 10
Time taken for tests: 269.158 seconds
Complete requests: 10000
Failed requests: 5272
(Connect: 0, Length: 5272, Exceptions: 0)
Non-2xx responses: 1868
Total transferred: 1891906 bytes
HTML transferred: 769177 bytes
Requests per second: 37.15
Transfer rate: 7.03 kb/s received
Connnection Times (ms)
min avg max
Connect: 0 0 5
Processing: 2 268 2771
Total: 2 268 2776
The interesting thing is that the crash only happens when an invalid SQL
statement is entered in the script below(notice the column "badcolumn"
which does not exist). If a valid SQL statement is entered ("badcolumn"
is removed), no crash occurs, and ApacheBench runs fine.
So I guess it is some problem with PHP's error-handler or MySQL
extension not being thread safe. No dll extensions were installed.
Standard pre-compiled PHP downloaded from php.net was used.
John Lim
======================= THE SCRIPT ===================
<?php
include "DB.php";
$DBNAME = 'PEAR DB';
$dsn = "mysql://root:@localhost/northwind";
$db = &DB::Connect($dsn);
$rs = $db->query('select
badcolumn,productid,productname,unitsinstock,unitprice from
products');
while (DB_OK === $rs->fetchInto($fields)) {
$id=$fields[0];
$name=$fields[1];
$unitsinstock=$fields[2];
$unitprice=$fields[3];
print "$id, $name, $unitsinstock, $unitprice<br>";
}
$rs->free();
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14886&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]