From: jlim@natsoft.com.my
Operating system: Win2000
PHP version: 4.1.1
PHP Bug Type: IIS related
Bug description: Access Violation in error handler with PEAR DB (ISAPI)
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 bug report at: http://bugs.php.net/?id=14886&edit=1