| Bug #35428 | crash when using mysqli with MySQL 5.0.16 | ||||
|---|---|---|---|---|---|
| Submitted: | 27 Nov 2005 9:12pm UTC | Modified: | 1 Dec 2005 12:23pm UTC | ||
| From: | marcing at smlw dot pl | Assigned to: | georg | ||
| Status: | Bogus | Category: | MySQLi related | ||
| Version: | 5CVS-2005-11-28 (snap) | OS: | WinXP SP2 | ||
| Votes: | 1 | Avg. Score: | 4.0 ± 0.0 | Reproduced: | 1 of 1 (100.0%) |
| Same Version: | 1 (100.0%) | Same OS: | 1 (100.0%) | ||
[27 Nov 2005 9:20pm UTC] tony2001@php.net
I can't reproduce it. Can you try it on an *nix OS ?
[27 Nov 2005 11:25pm UTC] marcing at smlw dot pl
Unfortunately i cannot reproduce it on unix at the moment (have to upgrade the mysql), but ill gladly provide further information on windows. hint: it is essential to create a table with content, im not sure if i provided enough of it;)
[27 Nov 2005 11:28pm UTC] tony2001@php.net
You don't have to *upgrade* it, you can install as much MySQL servers/clients as you want if you place it in different directories.
[28 Nov 2005 1:22am UTC] marcing at smlw dot pl
Im sorry, but i tried for 2 hours and i cant get mysqli to work under linux, winxp will have to be enough:(
[28 Nov 2005 1:25am UTC] sniper@php.net
Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip It's very much likely that this was already fixed.
[28 Nov 2005 12:29pm UTC] marcing at smlw dot pl
It seems that whole mysqli code has to be revised, since it still is very unstable, i think that other queries cause the crashes too, like some inserts for example... the SUM crash is not fixed in latest snapshot, and it seems that there r many more bugs and i still can't get my app to work (its using mysql heavily), i still get crashes and strange behaviours. If any developer is willing i can provide him with the code of this app so he can see what im talking about. Just write ur e-mail and ill contact u.
[28 Nov 2005 12:33pm UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. We're still unable to reproduce it.
[28 Nov 2005 12:53pm UTC] marcing at smlw dot pl
Thats the code to reproduce the crash: http://pl.maze.pl/tmp/test.php.txt Its used with this table - http://pl.maze.pl/tmp/db_table.sql But i dont think thats the only piece of code that causes the crash. just run http://localhost/test.php, then hit f5 and u should encouter it. (i can be only win platform related) ill do some further research in the meantime.
[28 Nov 2005 12:55pm UTC] marcing at smlw dot pl
Its not happening when using mysql ext, so im pretty sure its mysqli.
[28 Nov 2005 1:06pm UTC] tony2001@php.net
Works fine on Linux with MySQL 5.0.13.
[28 Nov 2005 1:15pm UTC] marcing at smlw dot pl
Here's there crash itself - http://pl.maze.pl/tmp/crash.jpg It takes 100% of CPU and then the crash...
[28 Nov 2005 1:18pm UTC] tony2001@php.net
As you may understand, the screenshot is not a backtrace and doesn't help in any way.
[28 Nov 2005 1:18pm UTC] marcing at smlw dot pl
Maybe >= 5.0.15 mysql is required? or maybe it is only windows platform issue.
[28 Nov 2005 1:20pm UTC] tony2001@php.net
Yeah, I'd appreciate if you find answers for these questions.
[28 Nov 2005 1:20pm UTC] marcing at smlw dot pl
Im not sure how to help You, what else can i do?
[28 Nov 2005 1:24pm UTC] tony2001@php.net
1) Try to downgrade MySQL on Windows and see if it changes anything. 2) Try to upgrade MySQL on Linux and see if it changes anything. This is so obvious, isn't it?
[28 Nov 2005 2:32pm UTC] marcing at smlw dot pl
Win: php 5.0.3 + mysql 4.1.7 - ok php 5.0.3 + mysql 5.0.16 - crash php 5.0.5 + mysql 5.0.15 - crash php 5.1 + mysql 5.0.16 - crash php 5.1.2-dev + mysql 5.0.16 - crash php 5.1.2-dev + mysql 4.1.15 - ok Linux: php 5.0.5 + mysql 4.1.13 - ok Thats all I can tell u for now.
[28 Nov 2005 2:40pm UTC] marcing at smlw dot pl
These were 3 machines.
[28 Nov 2005 3:20pm UTC] marcing at smlw dot pl
I dont know if its relevant, but i get exactly the same gdb backtrace as here http://bugs.php.net/bug.php?id=35388
[28 Nov 2005 3:21pm UTC] marcing at smlw dot pl
Now im sure its irrelevant, sorry.
[28 Nov 2005 3:27pm UTC] marcing at smlw dot pl
I forgot i was running mysql 4.1.15:) The backtrace from php 5.1.2-dev and mysql 5.0.16: Program received signal SIGSEGV, Segmentation fault. 0x00e654de in ?? () (gdb) bt #0 0x00e654de in ?? () #1 0x00000021 in ?? () #2 0x00374128 in ?? ()
[28 Nov 2005 4:11pm UTC] tony2001@php.net
If you'd install the latest CVS snapshot and the debug symbols, you'd propably get a bit better backtrace: http://snaps.php.net/ (c) Jani
[28 Nov 2005 6:00pm UTC] marcing at smlw dot pl
What do i do with these *.pdb files?
[29 Nov 2005 1:54am UTC] sniper@php.net
Extract them? And copy wherever you have the binaries and dlls for each file..
[29 Nov 2005 1:55am UTC] sniper@php.net
Assigned to the maintainer.
[30 Nov 2005 2:02pm UTC] 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
[30 Nov 2005 2:45pm UTC] marcing at smlw dot pl
What's the point of checking the same and unchanged file again?
[30 Nov 2005 2:47pm UTC] sniper@php.net
No, nothing. Don't bother, it's fixed. And reported by dozen other people too..
[30 Nov 2005 2:49pm UTC] tony2001@php.net
Why do you think it's unchanged? The url is the same, while file is regenerated every time.
[30 Nov 2005 3:49pm UTC] marcing at smlw dot pl
The size is unchanged, the bug still exists, so where is the difference?
[30 Nov 2005 3:56pm UTC] iliaa@php.net
Can't replicate on latest cvs.
[1 Dec 2005 10:27am UTC] marcing at smlw dot pl
Right, its better to pretend there is no problem, just stick a label "bogus" and forget. Why did a have a feeling that u wont care anyway? In the bug - http://bugs.php.net/bug.php?id=35388, georg might have given the reason and possible solution for this problem (my client version is 4.1.7 too). That could explain why u cant reprocude it. But its so hard to think...i know... Its time for u to paste this "Please try using this CVS snapshot:" text, right?
[1 Dec 2005 10:37am UTC] tony2001@php.net
MySQL client bugs should be reported in another place and they are obviously not PHP bugs.
[1 Dec 2005 12:16pm UTC] marcing at smlw dot pl
But its not the MySQL that crashes, is it? PDO and mysql extensions somehow dont have problem with different client versions, everything works fine, why mysqli can't?
[1 Dec 2005 12:23pm UTC] marcing at smlw dot pl
Fresh news - ive updated client version to 5.0.16, and the crash still occurs - only when using mysqli ext.

Description: ------------ Env: Windows XP SP2 Apache 2.0.48 / 2.0.55 (not relevant) MySQL 5.0.16 PHP 5.0.3 /5.1 (not relevant) MySQLi Important: Problem is related to MySQLi when using MySQL version 5 only, it doesn't occur with version 4. Reproduce code: --------------- <?php $db = new mysqli(...); if($stmt = $db->prepare('SELECT SUM(visitors) FROM core_stats')) { $stmt->execute(); $stmt->bind_result($total); $stmt->close(); } ?> The problem occurs when using SUM() in query, endless loop seems to start when $stmt->bind_result($total) is invoked and as a result Apache crashes. Database reproduction code: ---------------------------------- CREATE TABLE `core_stats` ( `id` int(10) unsigned NOT NULL auto_increment, `day_of_week` int(1) unsigned NOT NULL default '0', `day_of_month` int(2) unsigned NOT NULL default '0', `m` int(2) unsigned NOT NULL default '0', `y` int(4) unsigned NOT NULL default '0', `visitors` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `core_stats` VALUES (1, 2, 5, 7, 2005, 1); INSERT INTO `core_stats` VALUES (2, 3, 6, 7, 2005, 6); INSERT INTO `core_stats` VALUES (3, 4, 7, 7, 2005, 7); INSERT INTO `core_stats` VALUES (4, 5, 8, 7, 2005, 1); Expected result: ---------------- It should work as it worked on MySQL 4. Actual result: -------------- Internal Server Error