php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45160 PHP has encountered an Access Violation at 01B849C7
Submitted: 2008-06-03 12:57 UTC Modified: 2008-07-19 01:00 UTC
Votes:8
Avg. Score:4.8 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:3 (50.0%)
From: php at eklenet dot de Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.2.6 OS: Windows 2003 Server 32bit
Private report: No CVE-ID: None
 [2008-06-03 12:57 UTC] php at eklenet dot de
Description:
------------
hi,
i got the error :
  PHP has encountered an Access Violation at 01B849C7
on some sqls.
i have tried some php-version, 5.2.4, 5.2.5, 5.2.6 and php5.2-win32-latest.zip, on IIS ISAPI and Apache2 Mod, all the same. 

i think the the error must be in the PDO prepare statement, as you see a "A" is show with the SQL in the actual result, but never a "B" at the last line
The attatched output is complete.
The reproduce code is just a part of a big script.

Reproduce code:
---------------
...
$this->CONNECTION['handle'] =$dbh = new PDO('odbc:bluesheet', "sa","xxxx");
...
echo "A:$sql:";
$this->CONNECTION['response'] = $this->CONNECTION['handle']->prepare($sql);
echo "B";
$this->CONNECTION['response']->execute();
echo "C";

...

Expected result:
----------------
no error and correctly executed sqls.

Actual result:
--------------
PHP has encountered an Access Violation at 01B849C7A:SELECT id,name FROM bs_companies;:BCA:SELECT

 id,name FROM bs_users;:BCA:SELECT * FROM bs_salesmans;:BCA:INSERT INTO 

	bs_access_log

( 

	func , 

	ip , 

	ip_for , 

	session , 

	php_session , 

	browser , 

	login , 

	date

) VALUES ( 

	'muster_stueckliste_edit'	/* func */ , 

	'192.168.224.4'	/* ip */ , 

	''	/* ip_for */ , 

	'e9bc10605d413039c338efeaef5abef0'	/* session */ , 

	'8b1q4n09vhpvba2dqgfl7sh6t5'	/* php_session */ , 

	'Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'	/* browser

 */ , 

	'1'	/* login */ , 

	getdate()	/* date */

)

:BCA:SELECT 

	[function]

FROM 

	bs_functions4user

WHERE 

	user_id = '1'

:BCA:UPDATE 

	bs_stueckliste

SET 

	parent_id = '32' , 

	stueck = '2' , 

	details = '2' , 

	einheit = '2' , 

	verbrauch = DEFAULT , 

	groese = '2' , 

	farbe = DEFAULT , 

	positions = DEFAULT , 

	anz = DEFAULT

WHERE 

	id = '5' AND 

	ident = '64'

:

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-08 12:36 UTC] ncoesel at dealogic dot nl
I believe this bug is caused by calling getdate(). On my Linux machine calling getdate() crashes PHP consistently. I'll file a bug report shortly.
 [2008-06-08 14:42 UTC] php at eklenet dot de
but in the last sql was no getdate(), getdate()	was two sql before. 
all the errors are on Windows not on Linux. The ODBC-Connection points to a MS-SQL.
 [2008-06-08 16:02 UTC] pajoye@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.


 [2008-06-09 08:27 UTC] php at eklenet dot de
here:
http://space.eklenet.de/CrashHang_Memory_Report__PID_5904__06092008100613171.mht
but i dont see something in this report.
 [2008-06-09 08:40 UTC] pajoye@php.net
Thanks for the backtrace, can you try to create a small script to actually reproduce the crash?

Also if it is possible to configure your IIS to run a single thread, it may help to see what causes the crash. The backtrace does not show anything related to odbc or pdo.
 [2008-06-09 09:27 UTC] php at eklenet dot de
hi,
how do i run IIS as a single thread ?
i dont found a manual to that.
 [2008-06-09 14:25 UTC] php at eklenet dot de
i have modified my script to work on cli.
here are the dumps:
http://space.eklenet.de/CrashHang_Memory_Report.mht
http://space.eklenet.de/CrashHang_Report.mht
hope that helps !
 [2008-07-07 08:55 UTC] php at eklenet dot de
Have you now all informations to fix this Problem ?
 [2008-07-07 12:42 UTC] php at eklenet dot de
i have changed to odbc vom pdo_odbc and i got even a similar error:
PHP has encountered an Access Violation at 01CBFC71
mybe they use the same base code ?
 [2008-07-08 07:24 UTC] php at eklenet dot de
now i have tried odbtp.
what i get is 
PHP has encountered an Access Violation at 01B849C7
like with pdo
 [2008-07-09 08:37 UTC] php at eklenet dot de
hello,
i dont think its a internal problem from PHP.
Becouse i need to get my script work, i have made a externel script to fetch data from the database.
Here is sample code:
------------------------------------------------------
	public function run($sql)
	{
		echo " A";
		$this->CONNECTION['lastsql']= rawurlencode(base64_encode($sql));
		if(substr(strtoupper($sql),0,6)=="INSERT" OR substr(strtoupper($sql),0,6)=="UPDATE")
		{
			$type="get_field";
			$sql = ($this->CONNECTION['lastsql']);
			$url = "http://192.168.224.4/bluesheet/sql.php?type=$type&sql=$sql";
			$data = file_get_contents($url);
		}
		echo " B";
	
	}
------------------------------------------------------
so you see here is no database connection.
The Output of the Script is just:
PHP has encountered an Access Violation at 01B849C7 A B A B A B A
As you see it ends with A and not B so there musst be an internal PHP Problem not related to the Database !
 [2008-07-11 16:19 UTC] jani@php.net
But is that external script running on the same webserver as the one you're accessing?
 [2008-07-18 02:44 UTC] tmstruthers at cox dot net
I am also receiving a similar "Access violation" message...(PHP has encountered an Access Violation at 0116B74E) when trying to view a php web page I've created.  I've got PHP 5.2.6 loaded.  My page is mostly HTML with a PHP include for the header and a PGP include for a page footer (which contains a date function to get the current year).  I'm running on Windows XP Pro using IIS 5.1.  On average, I hit "refresh" about 20 times and receive this error 19 of the 20 times.  The page only loads correctly about 1 in 20 times.  This makes development extremely difficult.  This appears to be a bug within PHP as the page does eventually load (with no edits to the source) and then continues to fail when the page is reloaded.  If you need me to do something to help pinpoint the problem and assist, I'm willing to do so to get this problem corrected.
 [2008-07-18 06:20 UTC] php at eklenet dot de
I have found a work around for my Problem. Often when i use a class with a __tostring() function as string for a database-sql i got this error.
so i simply make a 
$sql = "$sql "; 
before i use the sql as query. Now my script works fine, but its just a work around.
 [2008-07-19 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 16:01:31 2024 UTC