Bug #13171 Valgrind error in mysql_client_test
Submitted: 14 Sep 2005 9:57 Modified: 22 Sep 2005 12:21
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0 OS:Linux (SuSE 9.1)
Assigned to: Jim Winstead CPU Architecture:Any

[14 Sep 2005 9:57] Konstantin Osipov
Description:
Valgrind produces numerous warnings when running mysql_client_test.
This is not prepared-statements related:

==29157== Thread 3:
==29157== Conditional jump or move depends on uninitialised value(s)
==29157==    at 0x823BFE6: create_tmp_field(THD*, st_table*, Item*, Item::Type, Item***, Field**, bool, bool, bool, unsigned) (sql_select.cc:8101)
==29157==    by 0x823CB3C: create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long, char*) (sql_select.cc:8359)
==29157==    by 0x822B8E6: JOIN::optimize() (sql_select.cc:1012)
==29157==    by 0x822EEFE: _Z12mysql_selectP3THDPPP4ItemP13st_table_listjR4ListIS1_ES2_jP8st_orderSB_S2_SB_mP13select_resultP18st_select_lex_unitP13st_select_lex (sql_select.cc:2085)
==29157==    by 0x82290E6: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:238)
==29157==    by 0x81EEA93: mysql_execute_command(THD*) (sql_parse.cc:2470)
==29157==    by 0x8258B4A: Prepared_statement::execute(String*, bool) (sql_prepare.cc:2803)
==29157==    by 0x8257076: mysql_stmt_execute(THD*, char*, unsigned) (sql_prepare.cc:2188)
==29157==    by 0x81EC9BE: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1634)
==29157==    by 0x81EC362: do_command(THD*) (sql_parse.cc:1468)
==29157==    by 0x81EB474: handle_one_connection (sql_parse.cc:1120)
==29157==    by 0x1BA5BAAB: thread_wrapper (vg_libpthread.c:867)
==29157==    by 0xB000F03A: do__quit (vg_scheduler.c:1872)

The error was there for at least one month.

How to repeat:
1. Start the server under valgrind:

export VALGRIND_OPTS=--num-callers=40 --leak-resolution=high --leak-check=yes --show-reachable=yes
valgrind --tool=memcheck ./mysqld

2. Run the client test against the server:
tests/mysql_client_test -uroot [connect string if necessary]

Numerous warnings will be printed to stdout of the server.
[14 Sep 2005 21:33] Jorge del Conde
Verified using a recent 5.0 bk clone
[14 Sep 2005 21:33] Jorge del Conde
I tested this under FC4
[22 Sep 2005 12:21] Konstantin Osipov
The error has been fixed separately.