Bug #27119 | server crash with integer division by zero during filesort on huge result | ||
---|---|---|---|
Submitted: | 14 Mar 2007 8:41 | Modified: | 27 May 2007 9:38 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: General | Severity: | S1 (Critical) |
Version: | 5.0.38BK | OS: | Windows (windows) |
Assigned to: | Damien Katz | CPU Architecture: | Any |
Tags: | bfsm_2007_04_05, crash, filesort |
[14 Mar 2007 8:41]
Shane Bester
[14 Mar 2007 8:43]
MySQL Verification Team
some debugger outputs from 5.0.38
Attachment: bug27119_debugger_info_5.0.38_windows.txt (text/plain), 10.65 KiB.
[15 Mar 2007 14:59]
MySQL Verification Team
i couldn't repeat a crash on linux 5.0.38, so maybe it's windows specific, again: mysql> create table `t2` as SELECT SQL_BIG_RESULT c1, c2, count(c3) as overlap FROM t1 -> GROUP BY c1, c2 HAVING count(c3) >=5; Query OK, 4 rows affected (14 hours 2 min 34.14 sec) Records: 4 Duplicates: 0 Warnings: 0
[12 Apr 2007 20:02]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/24425 ChangeSet@1.2437, 2007-04-12 16:01:52-04:00, dkatz@damien-katzs-computer.local +2 -0 Bug #27119 server crash with integer division by zero during filesort on huge result Fixed by changing an index variable from a signed int to unsigned int (uint).
[12 Apr 2007 20:23]
Damien Katz
I've been unable to reproduce this bug myself, but from the stack traces and dumps, it was easy to find the culprit. I'm going to see if Shane can apply my patches and varify it fixes the problem. Because of the difficulty and length of time required to reproduce this (many hours) we won't be adding an explicit test for it.
[19 Apr 2007 18:52]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/24932 ChangeSet@1.2436, 2007-04-19 14:52:09-04:00, dkatz@damien-katzs-computer.local +2 -0 Polishing: note added. --- Bug #27119 server crash with integer division by zero during filesort on huge result Fixed by changing an index variable from a signed int to unsigned int (uint).
[19 Apr 2007 19:13]
Damien Katz
While I've found the code flaw, I've not been able to reproduce this bug. I let my test machine run for week before giving up (it appeared to spend most all of its time in "alter table t1 enable keys;" statement). Reviewers keep this in mind. Because of the extremely long times to reproduce the bug (> 1 week), I wont be submitting any test case.
[30 Apr 2007 20:14]
Damien Katz
The previous commit does fix potential bugs, however it's not clear it fixes this bug. Based on the stack trace provided, the value of *maxbuffer must have been a number N where: (0x07FFFFFF & N) == 0x07FFFFFF. But those values should be illegal, so guarding against them. Need to figure out how its arriving at that value. I'm investigating ways to duplicate the bug to answer these questions.
[1 May 2007 19:03]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/25843 ChangeSet@1.2436, 2007-05-01 15:03:47-04:00, dkatz@damien-katzs-computer.local +2 -0 Bug #27119 server crash with integer division by zero during filesort on huge result
[16 May 2007 20:14]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/26877 ChangeSet@1.2485, 2007-05-16 16:14:13-04:00, dkatz@damien-katzs-computer.local +2 -0 Bug #27119 server crash with integer division by zero during filesort on huge result Added checks to detect integer overflow and fixed other bugs on the error path.
[17 May 2007 21:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/26932 ChangeSet@1.2487, 2007-05-17 17:54:31-04:00, dkatz@damien-katzs-computer.local +1 -0 Bug #27119 server crash with integer division by zero during filesort on huge result Fixed a compiler warning on platforms where uint != ulong from the first pushed fix.
[18 May 2007 0:45]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/26936 ChangeSet@1.2490, 2007-05-17 20:45:33-04:00, dkatz@damien-katzs-computer.local +1 -0 Bug #27119 server crash with integer division by zero during filesort on huge result Fixed a problem and compiler warning on 64bit platforms so that they only allocated UINT_MAX number of BUFFPEKS.
[22 May 2007 17:01]
Bugs System
Pushed into 5.1.19-beta
[22 May 2007 17:03]
Bugs System
Pushed into 5.0.44
[27 May 2007 9:38]
Paul DuBois
Noted in 5.0.44, 5.1.19 changelogs. A large filesort could result in a division by zero error and a server crash.