php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8434 PHP has encountered an Access Violation at 01292466
Submitted: 2000-12-27 07:27 UTC Modified: 2002-06-18 18:17 UTC
From: svanpoeck at mailplanet dot net Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.0.4 OS: Win 2K Server
Private report: No CVE-ID: None
 [2000-12-27 07:27 UTC] svanpoeck at mailplanet dot net
Still having same bug in PHP-4.0.4 Win ISAPI module...
Randomly showing error "PHP has encountered an Access Violation at 01292466" (the number changes every time the error occurs) upon call to PHP ISAPI engin. The error can occur on any of my 30+ scripts on this site.

This problem persists since at least 3.0.3pl1. When will this nightmare be over ?? I have to switch back to a CGI environment, which slows down PHP execution far too much...

Restarting IISAdmin does get the engine running properly again... until the next "Access Violation"...

Almost all of the bug reports concerning this error have not even been assigned to anyone. Does this mean you're not going to try to get rid of this problem ?

If you have any questions regarding the script below, do not hesitate to contact me!

All in all: thanks for bringing us PHP and keep up the good work !

Steven VAN POECK

One piece of code on which the error occurs:
--------------------------------------------
include( "common.php" );

// Call session (if any)
session_save_path("tmp");
session_start();
// Empty basket
$sql = "DELETE FROM panier WHERE client_id='$user'";
mysql_pconnect( $db_host, $db_user, $db_pass );
$result = mysql_db_query( $db_dag, $sql );
check_error( $result );

// Set user state to "D" (deconnected)
$sql = "UPDATE client SET state='D' WHERE id='$user'";
mysql_pconnect( $db_host, $db_user, $db_pass );
$result = mysql_db_query( $db_dag, $sql );
check_error( $result );

// destroy session (if any)
session_destroy();

// Get highest client ID
$sql = "SELECT MAX(id) AS max_id FROM client";
mysql_pconnect( $db_host, $db_user, $db_pass );
$result = mysql_db_query( $db_dag, $sql );
check_error( $result );
$data = mysql_fetch_object( $result );
$last_client = $data->max_id;
// Define new client ID
if( substr($last_client, 1) < 50000000 ){
	$numero_client = P50000101;	/* For very first client */
}else{
	$numero_client = "P".(substr($last_client, 1) + 1);
}
// Get password of the day
$today = date("Y-m-d", time());
$mdp = create_pass();
// Define timestamp for expiration time
$exp_time = time()+1800;

$sql = "INSERT INTO client VALUES( '$numero_client', PASSWORD('$mdp'), '$today', '$today', '0', 'DP', '$exp_time', 'C')";
mysql_pconnect( $db_host, $db_user, $db_pass );
$result = mysql_db_query( $db_dag, $sql );
check_error( $result );

// Initialise session
session_save_path( "tmp" );
session_register("user");
$user = $numero_client;
session_register("key");
$key = $mdp;
session_register("type");
$type = "p_";
session_register( "cadeau_1" );
$cadeau_1 = 0;
// Send user to the site
header( "Location:/pcgi/display_rubr.php?".SID."&rubr=".urlencode(${$type."rubr_def"}) );
-------------------------------------------------------
The function "create_pass()":
-------------------------------------------------------
function create_pass(){
global $db_host, $db_user, $db_pass, $db_adm;
$alpha = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z');
$n = 0;
$flag = 0;
// Select all passwords
$today = date("Y-m-d", time());
$sql = "SELECT * FROM mdp_jour";
mysql_pconnect( $db_host, $db_user, $db_pass );
$result = mysql_db_query( $db_adm, $sql );
while( $data = mysql_fetch_object( $result ) ){
  // Verify if today's password already exists		
  // If so, use that one
  if( date("Y-m-d", time()) == $data->date ){
	$pass = $data->mdp;
	$flag = 1;
  }
}
if( $flag != 1){
// No password for today yet
// So have to make one
	while( $n < 4 ){
	reset( $alpha );
	mt_srand((double)microtime()*1000000);
	$pass = mt_rand(0, 25);
	$password .= $alpha[$pass];
	$n++;
	}
	// Select all passwords
	$sql = "SELECT * FROM mdp_jour";
	mysql_pconnect( $db_host, $db_user, $db_pass );
	$result = mysql_db_query( $db_adm, $sql );
	while( $data = mysql_fetch_object( $result ) ){
		// Verify if created password already exists
		// If so, recreate another password
		if( eregi( $data->mdp, $password ) ){
			create_pass();
		}
	}
	// If not, generated password is unique. Write to DB
	if( $flag == 0 ){
		$pass = $password;
		$sql = "INSERT INTO mdp_jour VALUES('', '$today', '$password')";
		mysql_pconnect( $db_host, $db_user, $db_pass );
		$result = mysql_db_query( $db_adm, $sql );
		check_error( $result );
	}
}
return $pass;
}
----------------------------------------------------------

You'll need 2 databases:
DB1 ($db_dag in the script):
------- Table "panier":
Field	Type	Null	Key	Default	Extra	Privileges
id	int(11) unsigned zerofill		PRI		auto_increment	select,insert,update,references
client_id	varchar(10)			0		select,insert,update,references
produit_ref	varchar(50)					select,insert,update,references
produit_prix_ttc	float(5,2) unsigned			0		select,insert,update,references
prix_gift	enum('1','0')			1		select,insert,update,references
produit_n	int(3) unsigned			0		select,insert,update,references
expire	int(13)			0		select,insert,update,references

-------- Table "client":
Field	Type	Null	Key	Default	Extra	Privileges
id	varchar(10)		PRI			select,insert,update,references
pass	varchar(255)					select,insert,update,references
crea	date			0000-00-00		select,insert,update,references
mod	date			0000-00-00		select,insert,update,references
visits	int(5) unsigned zerofill		MUL	0		select,insert,update,references
type	enum('DP','DAG')			DP		select,insert,update,references
expire	int(13)			0		select,insert,update,references
state	enum('C','D')			D		select,insert,update,references

DB2 ($db_adm in the script):
------- Table "mdp_jour":
Field	Type	Null	Key	Default	Extra	Privileges
id	int(5) unsigned zerofill			0		select,insert,update,references
date	date			0000-00-00		select,insert,update,references
mdp	char(5)					select,insert,update,references

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-08 08:59 UTC] dbeu@php.net
can you please cut down the code to the min. needed to reproduce it?
 [2001-01-08 10:05 UTC] svanpoeck at mailplanet dot net
Well, that _is_ a good question: I have absolutely no idea which instruction causes the problem !

As said in my report, the error can appear on any of my 30+ scripts on the site. The error does not have a preference for any of the scripts either. It just appears _randomly_ on any of the scripts at a random time and at random frequency. I sometimes have the error 2 to 5 times a day, and sometimes it will not appear for 2 days at all. I know that doesn't help you much, but that's about as precise as I can be.

That's why I gave you all the information necessary to rebuild an exact copy of 1 of my scripts and see _if_ you get the error at all. It will be necessary though that you test it on the same platform as I run it: Win 2K Server with IIS 5.0 and PHP-4.0.4 as ISAPI (php4isapi.dll). The database runs on a separate server (Win NT4 Server SP6).

Hope you find a clue where to start looking (as a novice, I'd say in the .DLL). If you need any further information, do not hesitate !


Greetings,

Steven
 [2001-04-16 06:33 UTC] jmoore@php.net
ANother Access violation in IIS bug.

-James
 [2002-04-18 08:56 UTC] thomasp at gmx dot at
we're having nearly the same problem in our company. we're using iis 4 with nt, not 2k... shortly after a reboot the whole iis crashes (sort of). we are using asp and php in different webs. asp is down if the iis crashes. after deactivating mysql the server will work again... that's what we've encountered here today. i would be glad if someone could mail me some more information regarding this ACCESS VIOLATION topic...
 [2002-06-18 18:17 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2003-02-15 08:26 UTC] julien at touslesdrivers dot com
<b>Copy of the e-mail I send to the php team:</b>

Hello,
 
I am the webmaster of the website Touslesdrivers.com.
I use php 4.3.0 ISAPI under Windows 2000 Server SP3 / IIS 5.0 and an error often appears: PHP has encountered an Access Violation at 0109388E
When this error appears, the execution of the php code seems to be stopped and juste the half of the page is displayed with the error :(
This error appears randomly on all the website and I think it's a bug in the ISAPI module of php.
In CGI mode, it doesn't appears but performances are very bad :/
 
It's a very inconvenient bug, snif snif.
 
I have seen that I am not the only person which have this error:
Per exemple here: http://bugs.php.net/bug.php?id=8434
 
I tried a lot of parameters in the php.ini but nothing resolves the problem.
 
I signal so the bug to you. I think it will be perhaps better if I signal it on the http://bugs.php.net/ but I try before to mail it to you directly.
 
Sorry for the "bad" english and I hope you will be abble to resolve this bug in the next release.
 
Thanks you very much.
 
PS: You can go on http://www.touslesdrivers.com and after 5/6 pages you will probably have the error...
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Mar 04 08:01:25 2021 UTC