|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35857 Crash using mysqli_stmt_fetch
Submitted: 2005-12-31 02:09 UTC Modified: 2006-01-24 13:28 UTC
From: auroraeosrose at gmail dot com Assigned: andrey (profile)
Status: Not a bug Package: MySQLi related
PHP Version: 5CVS-2005-12-31 (snap) OS: WinXPSP2
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.
Block user comment
Status: Assign to:
Bug Type:
From: auroraeosrose at gmail dot com
New email:
PHP Version: OS:


 [2005-12-31 02:09 UTC] auroraeosrose at gmail dot com
Using mysqli_stmt_fetch or $stmt->fetch crashes apache/php

Broken with both mysql 5.0 and 4.1 

Reproduce code:
$mysqli = mysqli_connect("localhost", "root", "password", "db");

$mysqli->query("CREATE TABLE IF NOT EXISTS temp (id INT NOT NULL)");

$mysqli->query("INSERT INTO temp (id) VALUES

$stmt = $mysqli->prepare("SELECT id FROM temp");





$mysqli->query("DROP TABLE temp");

Expected result:

Actual result:
Apache/php go boom - I'd send a backtrace but until I get nice "I'm on windows and don't do C" directions that's not going to happen

I have the annoying windows dump files if they're even useful

trying the same thing procedural style does the same thing - through commenting out trial and error the actual crash occurs on the $stmt->fetch() line


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-31 02:10 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-12-31 03:25 UTC] auroraeosrose at gmail dot com
still happens - "Apache HTTP Server has encountered a problem and needs to close.  We are sorry for the inconvenience."

phpinfo says->
Build Date 	Dec 31 2005 00:19:15

don't think I can get any newer than that :)
 [2005-12-31 03:38 UTC]
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 for *NIX and 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.

 [2005-12-31 04:20 UTC] judas dot iscariote at gmail dot com
not reproducible in Linux amd64

$php mysqli.php

php -v
PHP 5.1.2RC2-dev (cli) (built: Dec 29 2005 14:53:40)
 [2005-12-31 04:33 UTC] auroraeosrose at gmail dot com
I assume this is the backtrace you're looking for

>	libmySQL.dll!00bf79ab() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for libmySQL.dll]	
 	php_mysqli.dll!zif_mysqli_stmt_fetch(int ht=0, _zval_struct * return_value=0x04fea498, _zval_struct * * return_value_ptr=0x00000000, _zval_struct * this_ptr=0x04fea470, int return_value_used=0, void * * * tsrm_ls=0x00e67cb0)  Line 651	C
 	php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data * execute_data=0x0419fb30, void * * * tsrm_ls=0x00e67cb0)  Line 192 + 0x35 bytes	C
 	php5ts.dll!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data * execute_data=0x0419fb30, void * * * tsrm_ls=0x00e67cb0)  Line 314 + 0x11 bytes	C
 	php5ts.dll!execute(_zend_op_array * op_array=0x0419ffa4, void * * * tsrm_ls=0x0419fc18)  Line 92 + 0xc bytes	C
 	ntdll.dll!_RtlFreeHeap@12()  + 0x130 bytes	
 	php5ts.dll!zend_ini_long(char * name=0x005d7980, unsigned int name_length=0, int orig=10)  Line 295 + 0xb bytes	C
 	msvcrt.dll!_strtol()  + 0x15 bytes	
 [2005-12-31 08:33 UTC]
Doesn't look like PHP problem to me.
Assigned to MySQL guys.
 [2006-01-01 17:43 UTC]
What's the version of the MySQL server?

 [2006-01-01 18:29 UTC]
Can't reproduce using the following combinations
client - server
 4.1 - 5.0
 4.1 - 5.1
 5.0 - 4.1

 [2006-01-02 16:59 UTC] auroraeosrose at gmail dot com
I can reproduce it with two server versions

5.0.15-nt server
5.0.15 client 

4.1.16-nt server
5.0.15 client

so 5.0 -> 5.0 and 5.0 -> 4.1
 [2006-01-02 23:28 UTC]
Are you sure you're using 5.0 client library? Did you recompile PHP mysqli extension linking it with 5.0 client library?
 [2006-01-03 02:23 UTC] auroraeosrose at gmail dot com
mysqli_get_client_info() gives me 5.0.15 client - I don't compile anything on windows, just put my php folder in the path variable
 [2006-01-10 17:48 UTC]
could you please try with php_mysqli.dll from ? 
 [2006-01-10 21:20 UTC] auroraeosrose at gmail dot com
Very nifty - now it works properly

any hope for getting a note in the docs with links to those downloads for people who run into problems?
 [2006-01-13 11:53 UTC]
Can you please try it with PHP 5.1.2?
 [2006-01-16 16:59 UTC] auroraeosrose at gmail dot com
Crashes with 5.1.2 as before and there isn't a dll for 5.1.2 on and the 5.1.1 php_mysqli.dll from there doesn't work - which means mysqli_stmt_fetch is now broken for me again..
 [2006-01-24 13:28 UTC]
Can't repeat

Tested with PHP 5.1.2, MySQL 5.0.18 and mysqli extension (for PHP 5.1.2 from
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 06:01:28 2024 UTC