Bug #61985 Valgrind errors on myisam-blob and almost_full 5.5 rev 3477
Submitted: 26 Jul 2011 14:04 Modified: 11 Mar 2014 9:17
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.5 OS:Linux (Ubuntu 11.06 x64)
Assigned to: CPU Architecture:Any

[26 Jul 2011 14:04] Laurynas Biveinis
Description:
The MTR tests main.myisam-blob and main.almost_full fail with the same backtraces under Valgrind:

main.myisam-blob                         w1 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2011-07-24 07:33:03
line
==9494== Thread 3:
==9494== Conditional jump or move depends on uninitialised value(s)
==9494==    at 0x963833: chk_del (mi_check.c:191)
==9494==    by 0x95F198: ha_myisam::check(THD*, st_ha_check_opt*) (ha_myisam.cc:825)
==9494==    by 0x697339: handler::ha_check(THD*, st_ha_check_opt*) (handler.cc:3181)
==9494==    by 0x6366BB: mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*)) (sql_admin.cc:606)
==9494==    by 0x636F8E: Check_table_statement::execute(THD*) (sql_admin.cc:992)
==9494==    by 0x5888F6: mysql_execute_command(THD*) (sql_parse.cc:4352)
==9494==    by 0x58D1F7: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5548)
==9494==    by 0x58E5BF: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1034)
==9494==    by 0x629D9E: do_handle_one_connection(THD*) (sql_connect.cc:789)
==9494==    by 0x629E50: handle_one_connection (sql_connect.cc:708)
==9494==    by 0x9543F8: pfs_spawn_thread (pfs.cc:1015)
==9494==    by 0x5037D8B: start_thread (pthread_create.c:304)
==9494==    by 0x610704C: clone (clone.S:112)

main.almost_full                         w1 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2011-07-24 08:10:14
line
==24888== Thread 13:
==24888== Conditional jump or move depends on uninitialised value(s)
==24888==    at 0x963833: chk_del (mi_check.c:191)
==24888==    by 0x95F198: ha_myisam::check(THD*, st_ha_check_opt*) (ha_myisam.cc:825)
==24888==    by 0x697339: handler::ha_check(THD*, st_ha_check_opt*) (handler.cc:3181)
==24888==    by 0x6366BB: mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*)) (sql_admin.cc:606)
==24888==    by 0x636F8E: Check_table_statement::execute(THD*) (sql_admin.cc:992)
==24888==    by 0x5888F6: mysql_execute_command(THD*) (sql_parse.cc:4352)
==24888==    by 0x58D1F7: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5548)
==24888==    by 0x58E5BF: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1034)
==24888==    by 0x629D9E: do_handle_one_connection(THD*) (sql_connect.cc:789)
==24888==    by 0x629E50: handle_one_connection (sql_connect.cc:708)
==24888==    by 0x9543F8: pfs_spawn_thread (pfs.cc:1015)
==24888==    by 0x5037D8B: start_thread (pthread_create.c:304)
==24888==    by 0x610704C: clone (clone.S:112)

How to repeat:
cmake options: -DWITH_VALGRIND=ON, -DHAVE_purify in CFLAGS and CXXFLAGS
[9 Aug 2011 8:40] Valeriy Kravchuk
What exact version, 5.5.x, you had used? I was not able to repeat with current mysql-5.5 (5.5.16) on 64-bit Fedora Core 14.
[9 Aug 2011 8:42] Valeriy Kravchuk
bzr revno returns 3486 in my case.
[9 Aug 2011 8:44] Laurynas Biveinis
I've have used bzr version, revision 3477 of lp:mysql-server/5.5.
[9 Aug 2011 12:36] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please send us all options you use when run cmake.
[10 Aug 2011 3:42] Laurynas Biveinis
The exact CMake options used are
CFLAGS= -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -O0 -g3 -gdwarf-2 CXXFLAGS= -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -O0 -g3 -gdwarf-2 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_VALGRIND=ON -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF

This and the rest of that build output can be found at 
http://jenkins.percona.com/job/mysql-5.5-trunk-valgrind/11/BUILD_TYPE=valgrind,Host=ubuntu...

The tests fail with a week-old 5.5 trunk too (rev 3483), the full log is at

http://jenkins.percona.com/job/mysql-5.5-trunk-valgrind/12/BUILD_TYPE=valgrind,Host=ubuntu...

Thank you.
[10 Aug 2011 17:53] Sveta Smirnova
Thank you for the feedback.

Verified as described.
[13 Sep 2012 12:41] MySQL Verification Team
still happens on 5.7.0 today:

Thread 23:
Conditional jump or move depends on uninitialised value(s)
at: chk_del (mi_check.c:191)
by: ha_myisam::check  (ha_myisam.cc:862)
by: handler::ha_check (handler.cc:3972)
by: mysql_admin_table (sql_admin.cc:638)
by: Sql_cmd_check_table::execute(THD*) (sql_admin.cc:1052)
by: mysql_execute_command(THD*) (sql_parse.cc:4788)
by: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:6054)
by: dispatch_command (sql_parse.cc:1314)
by: do_handle_one_connection(THD*) (sql_connect.cc:969)
by: handle_one_connection (sql_connect.cc:885)
by: start_thread (pthread_create.c:309)
by: clone (clone.S:115)

(gdb) p thd->query_string
$1 = {
  string = {
    str = 0x15ce6040 "check table `t2`",
    length = 16
  },
  cs = 0x1210fa0
}
(gdb)
[11 Mar 2014 9:17] Erlend Dahl
This has been fixed in 5.7.4:

      Tor Didriksen	2014-01-29
      Bug#14580121 VALGRIND FAILURE IN CHK_DEL() IN MYISAM CODE
      Bug#61985 Valgrind errors on myisam-blob and almost_full 5.5 rev 3477

      Initialize variables, to avoid valgrind warnings.