valgrind uninit variable in tokudb update_row_count

Description

Using percona server 5.7 @ github commit a369520.

When running mtr tokudb tests with vagrind-mysqld, valgrind reports the following jump based on an unitialized variable. Problem is caused by tokudb code that sometimes does NOT initialize the msg variable and ALWAYS uses it later.

Here is the valgrind error:
==29119== Conditional jump or move depends on uninitialised value(s)
==29119== at 0x4C2EB0E: strnlen (vg_replace_strmem.c:382)
==29119== by 0x1F08338: process_str_arg (my_vsnprintf.c:194)
==29119== by 0x1F0A168: my_vsnprintf_ex (my_vsnprintf.c:607)
==29119== by 0x1F0A5E6: my_vsnprintf (my_vsnprintf.c:670)
==29119== by 0x14E4DEB: error_log_print(loglevel, char const*, __va_list_tag*) (log.cc:2336)
==29119== by 0x14E5142: sql_print_information(char const*, ...) (log.cc:2386)
==29119== by 0x35073B72: TOKUDB_SHARE::update_row_count(THD*, unsigned long, unsigned long, unsigned long) (ha_tokudb.cc:391)
==29119== by 0x35087C43: ha_tokudb::external_lock(THD*, int) (ha_tokudb.cc:6493)
==29119== by 0xF87027: handler::ha_external_lock(THD*, int) (handler.cc:8028)
==29119== by 0x17B39F2: unlock_external(THD*, TABLE**, unsigned int) (lock.cc:665)
==29119== by 0x17B2F96: mysql_unlock_tables(THD*, st_mysql_lock*) (lock.cc:414)
==29119== by 0x155E71D: close_thread_tables(THD*) (sql_base.cc:1662)
==29119== by 0x15F872C: mysql_execute_command(THD*, bool) (sql_parse.cc:5219)
==29119== by 0x15F9EA2: mysql_parse(THD*, Parser_state*) (sql_parse.cc:5796)
==29119== by 0x15EE238: dispatch_command(THD*, COM_DATA const*, enum_server_command) (sql_parse.cc:1448)
==29119== by 0x15ED0BF: do_command(THD*) (sql_parse.cc:1011)

How to reproduce:
./mtr --valgrind-mysqld --mysqld='--plugin-load=tokudb=ha_tokudb.so;tokudb_trx=ha_tokudb.so;tokudb_locks=ha_tokudb.so;tokudb_lock_waits=ha_tokudb.so;tokudb_fractal_tree_info=ha_tokudb.so;tokudb_background_job_status=ha_tokudb.so' --mysqld=--loose-tokudb-check-jemalloc=0 --suite=tokudb.add_index add_index_3

Environment

None
Fixed

Assignee

George Lorch

Reporter

George Lorch

Labels

External issue ID

None

Freshdesk Tickets

None

Fix versions

Affects versions

Priority

Major