#35857 [Fbk->Opn]: Crash using mysqli_stmt_fetch

From: Date: Sat, 31 Dec 2005 03:33:23 +0000
Subject: #35857 [Fbk->Opn]: Crash using mysqli_stmt_fetch
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91294@lists.php.net to get a copy of this message
 ID:               35857
 User updated by:  auroraeosrose at gmail dot com
 Reported By:      auroraeosrose at gmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         MySQLi related
 Operating System: WinXPSP2
 PHP Version:      5CVS-2005-12-31 (snap)
 New Comment:

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]	
 	libmySQL.dll!00bf7aa3() 	
 	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	
 	04fe9250()


Previous Comments:
------------------------------------------------------------------------

[2005-12-31 04:20:26] judas dot iscariote at gmail dot com

not reproducible in Linux amd64

$php mysqli.php
int(1)

php -v
PHP 5.1.2RC2-dev (cli) (built: Dec 29 2005 14:53:40)

------------------------------------------------------------------------

[2005-12-31 03:38:43] 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.



------------------------------------------------------------------------

[2005-12-31 03:25:29] 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 02:10:55] sniper@php.net

Please try using this CVS snapshot:

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



------------------------------------------------------------------------

[2005-12-31 02:09:32] auroraeosrose at gmail dot com

Description:
------------
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
(1),(2),(3),(4)");


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

$stmt->execute();

$stmt->bind_result($id);

$stmt->fetch();
var_dump($id);

$stmt->close();


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

Expected result:
----------------
1

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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35857&edit=1


Thread (17 messages)

« previous php.bugs (#91294) next »