Bug #51057 | Weak code in diff_tables.inc can lead to 100% CPU consumption | ||
---|---|---|---|
Submitted: | 10 Feb 2010 11:44 | Modified: | 3 May 2010 20:00 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Patch approved | Impact on me: | |
Category: | MySQL Server: Tests | Severity: | S3 (Non-critical) |
Version: | 5.0+ | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | RQG |
[10 Feb 2010 11:44]
Matthias Leich
[10 Feb 2010 12:05]
Matthias Leich
Proposed fix: ------------- diff include/diff_tables.inc include/diff_tables_new.inc 96a97,105 > # Avoid Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption > if (`SELECT '$_diff_column_index' <= 0`) > { > --echo # ERROR in include/diff_tables.inc > --echo # '\$_diff_column_index' = '$_diff_column_index' <= 0 > --echo # Maybe the table $_diff_table does not exist. > --echo # abort > exit; > }
[10 Feb 2010 13:10]
Matthias Leich
Good hint by Philip: -------------------- "--die" leads to nice output in window where the test was started. My test: -------- "--die" replaces "exit;" ... main.ml003 [ fail ] Test ended at 2010-02-10 14:08:49 CURRENT_TEST: main.ml003 mysqltest: In included file "./include/diff_tables_new.inc": At line 104: The result from queries just before the failure was: Comparing tables does_not_exist.does_not_exist and does_not_exist.does_not_exist # ERROR in include/diff_tables.inc # '$_diff_column_index' = '' <= 0 # Maybe the table does_not_exist.does_not_exist does not exist. # abort
[12 Feb 2010 11:24]
Matthias Leich
Additional weak part which should be fixed: Ensure that in case of replication master and slave connection have the same @@session.time_zone value when selecting form the table.
[30 Apr 2010 15:44]
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/107109 3362 Matthias Leich 2010-04-29 Fix for Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption
[30 Apr 2010 15:50]
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/107112 3362 Matthias Leich 2010-04-30 Fix for Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption
[30 Apr 2010 15:50]
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/107113 3362 Matthias Leich 2010-04-30 Fix for Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption
[3 May 2010 13:26]
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/107200 3363 Matthias Leich 2010-05-03 Fix for Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption 1. Add check if the tables to be compared exist 2. Add check which ensures that we never go into the while loop with a value which is obvious wrong or might cause endless looping. (Assume the select on the information_schema gives from whatever reason a dangerous value) 3. Minor beautification
[3 May 2010 20:00]
Patrick Crews
Tested with the provided test case as well as with existing MTR tests using diff_tables. Patch fixes bug and has no discernible impact on current tests.
[10 May 2010 14:31]
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/107865 3377 Matthias Leich 2010-05-10 [merge] Merge fix for Bug#51057 into actual tree
[10 May 2010 14:43]
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/107871 3377 Matthias Leich 2010-05-10 Fix for Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption 1. Add check if the tables to be compared exist 2. Add check which ensures that we never go into the while loop with a value which is obvious wrong or might cause endless looping. (Assume the select on the information_schema gives from whatever reason a dangerous value) 3. Minor beautification
[20 May 2010 10:46]
Matthias Leich
Patch is queued to mysql-pe.
[28 May 2010 6:19]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:alik@sun.com-20100524190409-5w4l7mje1wk1c90l) (merge vers: 6.0.14-alpha) (pib:16)