Bug #37344 | Crash in IndexWalker::rebalanceDelete | ||
---|---|---|---|
Submitted: | 11 Jun 2008 13:59 | Modified: | 30 Sep 2008 20:08 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Falcon storage engine | Severity: | S1 (Critical) |
Version: | 6.0-falcon | OS: | Any |
Assigned to: | Ann Harrison | CPU Architecture: | Any |
[11 Jun 2008 13:59]
Philip Stoev
[12 Jun 2008 10:29]
Philip Stoev
Unsimplifed test case for bug 37344
Attachment: bug37344.test (application/octet-stream, text), 128.51 KiB.
[12 Jun 2008 10:36]
Philip Stoev
Please find attached a non-simplifed test case for this bug. Let me know if a simpler test case is required to fix this bug and I will work on it. Basically this crash happens on a statement of the form (either standalone or in a subquery): SELECT AVG( int_nokey ) FROM E AS X WHERE X . int_nokey < 69 GROUP BY int_key LIMIT 1; It is not sufficient to simply insert the data (the top of the test case) and then issue the SELECT (the last statement of the test case) -- at least some of the UPDATE operations (the middle of the test case) are also required.
[20 Jun 2008 21:15]
Ann Harrison
In IndexWalker, the class member "balance" is not initialized.
[29 Jun 2008 11:44]
Philip Stoev
I added balance = 0; to IndexWalker::IndexWalker, however the crash still happened on a longer run. The existing test case no longer fails, so I will try to provide a new one.
[29 Jun 2008 13:09]
Philip Stoev
The problem is that "higher" it not initialized: (gdb) print higher $2 = (IndexWalker *) 0x0 (gdb) print higher->balance Cannot access memory at address 0x0
[29 Jun 2008 13:19]
Philip Stoev
Grammar file for bug 37344
Attachment: bug37344.yy (text/plain), 1.54 KiB.
[29 Jun 2008 13:24]
Philip Stoev
To reproduce the issue, please check out the mysql-test-extra-6.0 tree and then: $ cd mysql-test-extra-6.0/mysql-test/gentest $ ./runall.pl --basedir=/path/to/mysql-6.0-falcon --engine=Falcon --grammar=/location/of/bug37344.yy This script will proceed to start a server and run randomly generated queries based on the grammar file. The crash will happen within 10 min after takeoff. Please ignore any errors reported by the test script itself -- it is not always able to generate semantically valid queries. The grammar file may contain queries that are not related to the bug in question. Please let me know if a simplifed test case, or a test case in a different format is required. It appears that the index must arrive to a certain state in order to crash, and it is very likely that any insert/update/delete mixture will arrive to a broken index eventually.
[29 Jun 2008 22:39]
Ann Harrison
If higher were not initialized, it would be 0XCCCCCC - zero is a legitimate value for higher. The code in question is rebalancing an AVL tree - at the lowest levels, both higher and lower are zero. That's not to say that there isn't a bug, just that having higher be zero is not necessarily the cause.
[10 Jul 2008 18:49]
Philip Stoev
New grammar for bug 37344
Attachment: bug37344.yy (application/octet-stream, text), 988 bytes.
[25 Jul 2008 18:11]
Ann Harrison
Change pushed to the team tree seems to solve the problem
[27 Jul 2008 2:10]
Kevin Lewis
Patch Approved, Code looks good.
[29 Jul 2008 11:37]
Kevin Lewis
Pushed to mysql-6.0-falcon-team
[22 Aug 2008 21:15]
Kevin Lewis
This is fixed in version 6.0.6
[30 Sep 2008 20:08]
Jon Stephens
Documented as follows in the 6.0.6 changelog: A large number of updates on a Falcon table followed by a query of the form SELECT AVG(int_non_key_column) FROM table AS x WHERE int_non_key_column < constant GROUP BY int_key_column LIMIT limit could crash the server.