php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36895 Access Violation and Faulting Application (both Apache & IIS)
Submitted: 2006-03-28 17:22 UTC Modified: 2007-07-09 13:17 UTC
Votes:15
Avg. Score:4.5 ± 0.7
Reproduced:13 of 13 (100.0%)
Same Version:7 (53.8%)
Same OS:10 (76.9%)
From: jsschuetz at knapheide dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 5.1.2 OS: server2003/WinXP Pro
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: jsschuetz at knapheide dot com
New email:
PHP Version: OS:

 

 [2006-03-28 17:22 UTC] jsschuetz at knapheide dot com
Description:
------------
IIS and/or Apache on Server 2003 faulting application error and PHP has encountered an Access Violation at 000224b2

When running IIS with PHP 5.1.2.2 I get random crashes with the message PHP has encountered an Access Violation at 000224b2 and an error message in event viewer throws the message: 

Faulting application w3wp.exe, version 6.0.3790.1830, faulting module ntdll.dll, version 5.2.3790.1830, fault address 0x000224b2.

I tried reinstalling IIS and PHP with no luck.

To tried to fix the problem by installing Apache 2.0.55 instead thinking it might be an IIS problem.

Now I don't see the Access Violation message, but I still get messages in event viewer that saying:

Faulting application Apache.exe, version 2.0.55.0, faulting module ntdll.dll, version 5.2.3790.1830, fault address 0x000224b2.
   
and 

Faulting application Apache.exe, version 2.0.55.0, faulting module cwbrw.dll, version 0.0.0.0, fault address 0x00007fbd.


Reproduce code:
---------------
I have not been able to isolate specific code that is causing this problem.  The error seems to come at random and this is on a production server running many PHP apps.    


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-12 13:30 UTC] jsschuetz at knapheide dot com
I narrowed down the code causing the problem.  The below is the entire program that will cause the error at random.

I am connecting to a DB2 database on an AS400 Iseries with ODCB drivers provided by IBM client access software.


---------------------------------------------------------
$con = odbc_connect('as400','username','password');   
?>
<META HTTP-EQUIV="Refresh" CONTENT="2;URL=nester.php">
<BR />
Version 6
<br />
<?
$SSnestfiles = "Select * from pdatalib.nestsumpf where nesalpha = 'D' order by NESDTE DESC, NESTIME DESC";
$SRnestfiles = odbc_exec($con,$SSnestfiles);
while($nestfilearray = odbc_fetch_array($SRnestfiles))
{
}


The issue occurs with the odbc_fetch array call.  If the 
"while($nestfilearray = odbc_fetch_array($SRnestfiles))" is commented out the code will run fine forever, with the statement in, there will be random crashes as described previously.

The Meta refresh is simply there to keep executing the code because the error occurs at random.  In a test environment I opened 6 instances of the program and allowed them to sit refreshing every 2 secs.  The error would occur every 2 to 20 mins.  With IIS, it would crash and need to be restarted with a PHP Access Violation, with Apache there would just be an event log and the Apache service would restart.
 [2006-04-12 14:59 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-04-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, 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".
 [2006-08-02 10:50 UTC] matthius at pointbtel dot com
I'm fairly certain that I am suffering from this same bug. 
Though I am not using ODBC, I do however hit MySQL pretty 
hard. 

Sadly I'm not equipped to generate a backtrace on this 
machine. This is a major problem though, I am going to have 
to roll everything back to PHP4 bacause i can't seem to keep 
Apache on its feet for more than 15 min as it is. 

I'm currently running PHP 5.1.4 and I've tried Apache 2.0.53 
and 2.2.3. - both die the same way :-(

- Matt
 [2006-09-07 13:49 UTC] karlsonas at mazylis dot lt
Hi,

I've tryed several combinations of Apache/PHP and found only one which still generated error, but Apache recovers from crach and continues to work. It's PHP 5.1.1/Apache 2.0.55

Combinations on which Apache crashes without recovering:
PHP5.1.4/Apache2.0.58
PHP5.1.6/Apache2.0.59
PHP5.1.1/Apache2.0.59
PHP5.1.6/Apache2.0.55

I have two servers - test and production with exact configuration and code. And strangest thing that I have PHP5.1.4/Apache2.0.58 working without any problems on test server and can't get it crash at all. On production server I have crach after 15-30mins after upgrade.

Of course production server is used by 100-200 users...
I've tryed to look through acceess/error logs but really can't find what is cousing this crash ...

Could You please give me a way to debug that not rising production servers resources use ?
I will try to follow instructions on back-trace .. but it's kind a hard on prod server :)
Wish me luch :)
 [2006-09-07 13:51 UTC] karlsonas at mazylis dot lt
P.S. I'm on Win2K3, using MySQL 5.0.x
 [2006-09-07 13:57 UTC] tony2001@php.net
Please try using this CVS snapshot:

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


 [2006-09-07 14:47 UTC] jsschuetz at knapheide dot com
We were able to solve the problem.  It had to do with null terminated strings in the DB2 database on the AS400.  There must be an issue with the IBM ODBC driver or something that does not always handle the data/error appropriately and when and error is thrown it crashes PHP and the web server. When we stopped null terminating the data in the table, the problem when away.

Hope this helps
 [2007-07-09 13:17 UTC] jani@php.net
Since we don't have the backtrace I'm assuming it was crashing in the 3rd party library and not PHP itself.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC