php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44241 PHP Access Violation on Mysqli->fetch_array()
Submitted: 2008-02-25 12:07 UTC Modified: 2008-03-07 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: alessandroministeri at hotmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.2.5 OS: Windows Vista Home Premium
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-02-25 12:07 UTC] alessandroministeri at hotmail dot com
Description:
------------
Hi all,
i've founded a bug with MySQL 5.1.23 when perform a fetch_array() MySQLI method.

It return an Access Violation.

I'm tried on PHP 5.X both on CGI and ISAPI Mode with iis 7.0

I rollback to MySQL 5.0.x and it runs correctly.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-28 23:18 UTC] felipe@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-03-07 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".
 [2008-04-05 21:26 UTC] aroni125 at gmail dot com
I was able to reproduce this error twice before it worked normally.

This is the backtrace that I could get.
I was unable to get the place in the source where the error is.

Thread 0 - System ID 3540
Entry point   php+2fb2 
Create time   4/5/2008 4:04:04 PM 
Time spent in user mode   0 Days 0:0:0.31 
Time spent in kernel mode   0 Days 0:0:0.93 

Function     Arg 1     Arg 2     Arg 3   Source 
php_mysqli!get_module+154b     00c0fb10     76299fab     01febdaa    
msvcrt!_getptd+8     01febdaa     00c0fb28     762add1d    
msvcrt!_LocaleUpdate::_LocaleUpdate+18     01fee9a0     01fee9d0     00000000    
php_mysqli!php_mysqli_set_error+5f17     00000001     01fee9d0     00000000    
php5ts!execute+a29     00000000     00000000     00000000    

PHP_MYSQLI!GET_MODULE+154BWARNING - DebugDiag was not able to locate debug symbols for php_mysqli.dll, so the information below may be incomplete.

In php__PID__3136__Date__04_05_2008__Time_04_04_24PM__490__Second_Chance_Exception_C0000005.dmp the assembly instruction at php_mysqli!get_module+154b in C:\Users\Joshua D. Washburn\Desktop\PHPMysql\PHP\php_mysqli.dll from The PHP Group has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 0

This is the test case:
--TEST--
Bug 44241: PHP Access Violation on Mysqli->fetch_array()
--FILE--
<?
/*
Database:
CREATE DATABASE alpha;
USE alpha;
CREATE TABLE beta (ID INT AUTO_INCREMENT UNIQUE KEY, Name TEXT);
INSERT INTO beta ("Name") VALUES ("Joshua");
INSERT INTO beta ("Name") VALUES ("Test");
INSERT INTO beta ("Name") VALUES ("Gamma");
INSERT INTO beta ("Name") VALUES ("Computer");
*/

$db = new mysqli("localhost","root");
$result = $db->query("SELECT * FROM alpha.beta");
while ($row = $result->fetch_array(MYSQLI_ASSOC))
{
	echo "[".$row["Name"]."]";
}
$result = $db->query("SELECT * FROM alpha.beta");
while ($row = $result->fetch_array(MYSQLI_NUM))
{
	echo "[".$row[1]."]";
}
$result = $db->query("SELECT * FROM alpha.beta");
while ($row = $result->fetch_array(MYSQLI_BOTH))
{
	echo "[".$row["Name"]."|".$row[1]."]";
}
?>
--EXPECT--
[Joshua][Test][Gamma][Computer][Joshua][Test][Gamma][Computer][Joshua|Joshua][Test|Test][Gamma|Gamma][Computer|Computer]
===DONE===
 [2008-04-06 18:00 UTC] aroni125 at gmail dot com
I can only reproduce the error if the libmysql.dll is replaced with a different version. Using the bundled version does not cause the problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 10 21:01:31 2024 UTC