Bug #59157 valgrind conditional jump warning from dict_load_foreign
Submitted: 24 Dec 2010 15:54 Modified: 19 Jan 2011 23:52
Reporter: Mark Callaghan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.1.52, 5.1 bzr OS:Any
Assigned to: Jimmy Yang CPU Architecture:Any
Tags: builtin, innodb, mtr, valgrind

[24 Dec 2010 15:54] Mark Callaghan
Description:
Many tests get "conditional jump or move depends on unitialized values" valgrind warnings for builtin InnoDB

That includes innodb.innodb innodb.innodb_misc1 innodb.innodb_mysql main.partition_innodb 
main.cache_innodb innodb.innodb_bug21704 innodb.innodb_bug47621 innodb.innodb_bug48024

Example valgrind stacks include:

==444== Thread 11:
==444== Conditional jump or move depends on uninitialised value(s)
==444==    at 0x8888B9: dict_load_foreign (dict0load.c:1241)
==444==    by 0x888BE1: dict_load_foreigns (dict0load.c:1389)
==444==    by 0x8DF5BE: row_table_add_foreign_constraints (row0mysql.c:2162)
==444==    by 0x85D47A: ha_innobase::create(char const*, st_table*, st_ha_create_information*) (ha_innodb.cc:5739)
==444==    by 0x7670F0: handler::ha_create(char const*, st_table*, st_ha_create_information*) (handler.cc:3403)
==444==    by 0x76A7AB: ha_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, bool) (handler.cc:3610)
==444==    by 0x714861: rea_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, List<Create_field>&, unsigned, st_key*, handler*) (unir
eg.cc:421)
==444==    by 0x7913D6: mysql_create_table_no_lock(THD*, char const*, char const*, st_ha_create_information*, Alter_info*, bool, unsigned) (sql_table.cc:3979)
==444==    by 0x79399F: mysql_alter_table(THD*, char*, char*, st_ha_create_information*, TABLE_LIST*, Alter_info*, unsigned, st_order*, bool) (sql_table.cc:7225)
==444==    by 0x629402: mysql_execute_command(THD*) (sql_parse.cc:2968)
==444==    by 0x6304B2: mysql_parse(THD*, char*, unsigned, char const**) (sql_parse.cc:6051)
==444==    by 0x631E2E: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1260)
==444==    by 0x6332A6: do_command(THD*) (sql_parse.cc:888)
==444==    by 0x61F36C: handle_one_connection (sql_connect.cc:1136)
==444==    by 0x328F8062F6: start_thread (in /lib64/libpthread-2.5.so)
==444==    by 0x328ECD1E3C: clone (in /lib64/libc-2.5.so)
==444== Conditional jump or move depends on uninitialised value(s)
==444==    at 0x8888B9: dict_load_foreign (dict0load.c:1241)
==444==    by 0x888BE1: dict_load_foreigns (dict0load.c:1389)
==444==    by 0x8E266C: row_rename_table_for_mysql (row0mysql.c:3923)
==444==    by 0x85BF06: ha_innobase::rename_table(char const*, char const*) (ha_innodb.cc:6098)
==444==    by 0x76719A: handler::ha_rename_table(char const*, char const*) (handler.cc:3358)
==444==    by 0x79038C: mysql_rename_table(handlerton*, char const*, char const*, char const*, char const*, unsigned) (sql_table.cc:4203)
==444==    by 0x794519: mysql_alter_table(THD*, char*, char*, st_ha_create_information*, TABLE_LIST*, Alter_info*, unsigned, st_order*, bool) (sql_table.cc:7482)
==444==    by 0x629402: mysql_execute_command(THD*) (sql_parse.cc:2968)
==444==    by 0x6304B2: mysql_parse(THD*, char*, unsigned, char const**) (sql_parse.cc:6051)
==444==    by 0x631E2E: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1260)
==444==    by 0x6332A6: do_command(THD*) (sql_parse.cc:888)
==444==    by 0x61F36C: handle_one_connection (sql_connect.cc:1136)
==444==    by 0x328F8062F6: start_thread (in /lib64/libpthread-2.5.so)
==444==    by 0x328ECD1E3C: clone (in /lib64/libc-2.5.so)

==1071== Thread 11:
==1071== Conditional jump or move depends on uninitialised value(s)
==1071==    at 0x8888B9: dict_load_foreign (dict0load.c:1241)
==1071==    by 0x888BE1: dict_load_foreigns (dict0load.c:1389)
==1071==    by 0x8DF5BE: row_table_add_foreign_constraints (row0mysql.c:2162)
==1071==    by 0x85D47A: ha_innobase::create(char const*, st_table*, st_ha_create_information*) (ha_innodb.cc:5739)
==1071==    by 0x7670F0: handler::ha_create(char const*, st_table*, st_ha_create_information*) (handler.cc:3403)
==1071==    by 0x76A7AB: ha_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, bool) (handler.cc:3610)
==1071==    by 0x714861: rea_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, List<Create_field>&, unsigned, st_key*, handler*) (uni
reg.cc:421)
==1071==    by 0x7913D6: mysql_create_table_no_lock(THD*, char const*, char const*, st_ha_create_information*, Alter_info*, bool, unsigned) (sql_table.cc:3979)
==1071==    by 0x7917FA: mysql_create_table(THD*, char const*, char const*, st_ha_create_information*, Alter_info*, bool, unsigned) (sql_table.cc:4076)
==1071==    by 0x628C03: mysql_execute_command(THD*) (sql_parse.cc:2805)
==1071==    by 0x6304B2: mysql_parse(THD*, char*, unsigned, char const**) (sql_parse.cc:6051)
==1071==    by 0x631E2E: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1260)
==1071==    by 0x6332A6: do_command(THD*) (sql_parse.cc:888)
==1071==    by 0x61F36C: handle_one_connection (sql_connect.cc:1136)
==1071==    by 0x328F8062F6: start_thread (in /lib64/libpthread-2.5.so)
==1071==    by 0x328ECD1E3C: clone (in /lib64/libc-2.5.so)
==1071== Conditional jump or move depends on uninitialised value(s)
==1071==    at 0x8888B9: dict_load_foreign (dict0load.c:1241)
==1071==    by 0x888BE1: dict_load_foreigns (dict0load.c:1389)
==1071==    by 0x8E266C: row_rename_table_for_mysql (row0mysql.c:3923)
==1071==    by 0x85BF06: ha_innobase::rename_table(char const*, char const*) (ha_innodb.cc:6098)
==1071==    by 0x76719A: handler::ha_rename_table(char const*, char const*) (handler.cc:3358)
==1071==    by 0x79038C: mysql_rename_table(handlerton*, char const*, char const*, char const*, char const*, unsigned) (sql_table.cc:4203)
==1071==    by 0x794519: mysql_alter_table(THD*, char*, char*, st_ha_create_information*, TABLE_LIST*, Alter_info*, unsigned, st_order*, bool) (sql_table.cc:7482)
==1071==    by 0x628DF0: mysql_execute_command(THD*) (sql_parse.cc:2854)
==1071==    by 0x6304B2: mysql_parse(THD*, char*, unsigned, char const**) (sql_parse.cc:6051)
==1071==    by 0x631E2E: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1260)
==1071==    by 0x6332A6: do_command(THD*) (sql_parse.cc:888)
==1071==    by 0x61F36C: handle_one_connection (sql_connect.cc:1136)
==1071==    by 0x328F8062F6: start_thread (in /lib64/libpthread-2.5.so)
==1071==    by 0x328ECD1E3C: clone (in /lib64/libc-2.5.so)
^ Found warnings in /s/bld/5152orig/mysql-test/var/log/mysqld.1.err

How to repeat:
I use centos 5.2, 64-bit x86, gcc 4.1.2, valgrind 3.2.1, unmodified mysql 5.1.52

./configure --enable-thread-safe-client --with-plugins=partition,csv,blackhole,myisam,heap,innodb_plugin,innobase --with-fast-mutexes --with-extra-charsets=all --with-debug C_EXTRA_FLAGS="-fno-omit-frame-pointer -fno-strict-aliasing -DHAVE_purify -DUNIV_DEBUG_VALGRIND -Wall" CFLAGS="-O0 -g" CXXFLAGS="-O0 -g"

mysql-test-run.pl --force --force-restart --valgrind
[24 Dec 2010 19:11] Sveta Smirnova
Thank you for the report.

Verified as described using latest source tree.
[30 Dec 2010 12:45] Marko Mäkelä
I believe that Jimmy has last worked on this area.
[5 Jan 2011 3:30] Jimmy Yang
From 5.1 plugin, the table structure is allocated with mem_heap_zalloc(), so it is not necessary explicitly set the variable to zero in dict_mem_table_create() any more.
[5 Jan 2011 3:31] Jimmy Yang
From 5.1 plugin, the table structure is allocated with mem_heap_zalloc(), so it is not necessary explicitly set the variable to zero in dict_mem_table_create() any more.
[8 Jan 2011 15:08] Bugs System
Pushed into mysql-trunk 5.6.2 (revid:vasil.dimov@oracle.com-20110108150732-8qygun7nuaqf9d3u) (version source revid:vasil.dimov@oracle.com-20110108150646-44c9j7ck64ocey31) (merge vers: 5.6.2) (pib:24)
[8 Jan 2011 15:09] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:vasil.dimov@oracle.com-20110108150508-gpanhz48z8069qot) (version source revid:vasil.dimov@oracle.com-20110108150048-b1y9m8xe72hay0ch) (merge vers: 5.5.9) (pib:24)
[8 Jan 2011 15:11] Bugs System
Pushed into mysql-5.1 5.1.55 (revid:vasil.dimov@oracle.com-20110108145923-0tjqdpa5w3d6tuwn) (version source revid:vasil.dimov@oracle.com-20110108145923-0tjqdpa5w3d6tuwn) (merge vers: 5.1.55) (pib:24)
[10 Jan 2011 22:02] John Russell
Closing without a doc changelog entry.
[19 Jan 2011 23:52] Mark Callaghan
Can you link to the commit URL?
[20 Jan 2011 0:45] Davi Arnaut
bzr log -p -rrevid:jimmy.yang@oracle.com-20110105063146-kn77vcs6ujxm1ye2