Bug #44358 | valgrind errors with decode() function | ||
---|---|---|---|
Submitted: | 20 Apr 2009 5:49 | Modified: | 12 May 2009 2:47 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: General | Severity: | S1 (Critical) |
Version: | 5.1.32, 5.1.35 | OS: | Linux |
Assigned to: | Sergei Glukhov | CPU Architecture: | Any |
Tags: | decode, GIGO, valgrind |
[20 Apr 2009 5:49]
Shane Bester
[20 Apr 2009 9:18]
MySQL Verification Team
a more potent testcase, that causes invalid reads of memory (hence, can crash)
Attachment: bug44358_new_testcase.sql (application/unknown, text), 6.32 KiB.
[20 Apr 2009 9:19]
MySQL Verification Team
the new testcase valgrind outputs from 5.1.32
Attachment: bug44358_new_valgrind_outputs.txt (text/plain), 16.90 KiB.
[20 Apr 2009 9:27]
MySQL Verification Team
import the attached testcase multiple times, when running mysqld under valgrind. it seems the invalid read of memory happens inside some previously allocated buffer that was used for another purpose. so multiple runs can be needed. invalid reads of memory could cause crashes on picky platforms, so this is important to fix.
[21 Apr 2009 9:06]
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/72549 2863 Sergey Glukhov 2009-04-21 Bug#44358 valgrind errors with decode() function Functions decode() & encode() produce valgrind warnings. The fix is to use c_ptr_safe() instead of c_ptr() @ mysql-test/r/func_str.result test result @ mysql-test/t/func_str.test test case @ sql/item_strfunc.cc Functions decode() & encode() produce valgrind warnings. The fix is to use c_ptr_safe() instead of c_ptr()
[23 Apr 2009 8: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/72696 2863 Sergey Glukhov 2009-04-23 Bug#44358 valgrind errors with decode() function The warning happens because string argument is not zero ended. The fix is to add new parameter 'length' to SQL_CRYPT() and use ptr() instead of c_ptr(). @ mysql-test/r/func_str.result test result @ mysql-test/t/func_str.test test case @ sql/item_strfunc.cc Added new parameter 'length' to SQL_CRYPT @ sql/sql_crypt.cc Added new parameter 'length' to SQL_CRYPT @ sql/sql_crypt.h Added new parameter 'length' to SQL_CRYPT
[23 Apr 2009 8: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/72697 2864 Sergey Glukhov 2009-04-23 Bug#44358 valgrind errors with decode() function The warning happens because string argument is not zero ended. The fix is to add new parameter 'length' to SQL_CRYPT() and use ptr() instead of c_ptr(). @ mysql-test/r/func_str.result test result @ mysql-test/t/func_str.test test case @ sql/item_strfunc.cc Added new parameter 'length' to SQL_CRYPT @ sql/sql_crypt.cc Added new parameter 'length' to SQL_CRYPT @ sql/sql_crypt.h Added new parameter 'length' to SQL_CRYPT
[5 May 2009 19:37]
Bugs System
Pushed into 5.1.35 (revid:davi.arnaut@sun.com-20090505190206-9xmh7dlc6kom8exp) (version source revid:davi.arnaut@sun.com-20090505190206-9xmh7dlc6kom8exp) (merge vers: 5.1.35) (pib:6)
[6 May 2009 14:06]
Bugs System
Pushed into 6.0.12-alpha (revid:svoj@sun.com-20090506125450-yokcmvqf2g7jhujq) (version source revid:sergey.glukhov@sun.com-20090423084237-j570b1umgk6tb4ha) (merge vers: 6.0.11-alpha) (pib:6)
[12 May 2009 2:47]
Paul DuBois
Noted in 5.1.35, 6.0.12 changelogs. Valgrind warnings for the DECODE(), ENCRYPT(), and FIND_IN_SET() functions were corrected.
[15 Jun 2009 8:24]
Bugs System
Pushed into 5.1.35-ndb-6.3.26 (revid:jonas@mysql.com-20090615074202-0r5r2jmi83tww6sf) (version source revid:jonas@mysql.com-20090615070837-9pccutgc7repvb4d) (merge vers: 5.1.35-ndb-6.3.26) (pib:6)
[15 Jun 2009 9:04]
Bugs System
Pushed into 5.1.35-ndb-7.0.7 (revid:jonas@mysql.com-20090615074335-9hcltksp5cu5fucn) (version source revid:jonas@mysql.com-20090615072714-rmfkvrbbipd9r32c) (merge vers: 5.1.35-ndb-7.0.7) (pib:6)
[15 Jun 2009 9:44]
Bugs System
Pushed into 5.1.35-ndb-6.2.19 (revid:jonas@mysql.com-20090615061520-sq7ds4yw299ggugm) (version source revid:jonas@mysql.com-20090615054654-ebgpz7elwu1xj36j) (merge vers: 5.1.35-ndb-6.2.19) (pib:6)