php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14886 Access Violation in error handler with PEAR DB (ISAPI)
Submitted: 2002-01-06 06:15 UTC Modified: 2002-11-19 01:00 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: jlim at natsoft dot com dot my Assigned:
Status: No Feedback Package: IIS related
PHP Version: 4.1.1 OS: Win2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jlim at natsoft dot com dot my
New email:
PHP Version: OS:

 

 [2002-01-06 06:15 UTC] jlim at natsoft dot com dot my
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();

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-07 01:20 UTC] jlim at natsoft dot com dot my
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

 [2002-11-03 11:16 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-11-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC