valgrind uninit variable problem in tokudb's lz_encoder_prepare function

Bug #1572524 reported by rich prohaska on 2016-04-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
New
Undecided
Unassigned

Bug Description

Valgrind reports an uninitized variable in the lzma encoder function when running mtr tokudb tests. This is a problem in the lzma code. The lzma code can be fixed, or replaced with a recent version that fixes this problem, or valgrind can be made to ignore this problem. One of these changes should be made so that valgrind runs of the tokudb mtr tests can be done.

Further discussion:
http://prohaska7.blogspot.com/2015/11/uninitialized-data-problem-in-lzma.html

Valgrind report:
==18070== Conditional jump or move depends on uninitialised value(s)
==18070== at 0x351B287D: lz_encoder_prepare (lz_encoder.c:222)
==18070== by 0x351B2FA2: lzma_lz_encoder_init (lz_encoder.c:516)
==18070== by 0x351B2706: lzma_raw_coder_init (filter_common.c:212)
==18070== by 0x351A6199: block_encode_normal (block_buffer_encoder.c:192)
==18070== by 0x351A6199: lzma_block_buffer_encode (block_buffer_encoder.c:258)
==18070== by 0x351A57B0: lzma_stream_buffer_encode (stream_buffer_encoder.c:93)
==18070== by 0x351A7DAB: lzma_easy_buffer_encode (easy_buffer_encoder.c:27)
==18070== by 0x3519CFA9: toku_compress(toku_compression_method, unsigned char*, unsigned long*, unsigned char const*, unsigned long) (compress.cc:141)
==18070== by 0x3519561A: compress_nocrc_sub_block(sub_block*, void*, unsigned int, toku_compression_method) (sub_block.cc:204)
==18070== by 0x35180DC4: compress_ftnode_sub_block(sub_block*, toku_compression_method) (ft_node-serialize.cc:384)
==18070== by 0x35181190: serialize_and_compress_partition(ftnode*, int, toku_compression_method, sub_block*, serialize_times*) (ft_node-serialize.cc:496)
==18070== by 0x35181397: serialize_and_compress_serially(ftnode*, int, toku_compression_method, sub_block*, serialize_times*) (ft_node-serialize.cc:544)
==18070== by 0x35181EA7: toku_serialize_ftnode_to_memory(ftnode*, ftnode_disk_data**, unsigned int, toku_compression_method, bool, bool, unsigned long*, unsigned long*, char**) (ft_node-serialize.cc:6\
88)
==18070== by 0x35182580: toku_serialize_ftnode_to(int, blocknum_s, ftnode*, ftnode_disk_data**, bool, ft*, bool) (ft_node-serialize.cc:806)
==18070== by 0x35113CC7: toku_ftnode_flush_callback(cachefile*, int, blocknum_s, void*, void**, void*, pair_attr_s, pair_attr_s*, bool, bool, bool, bool) (ft-ops.cc:691)
==18070== by 0x350E7BC9: cachetable_only_write_locked_data(evictor*, ctpair*, bool, pair_attr_s*, bool) (cachetable.cc:653)
==18070== by 0x350EB76F: cachetable_flush_pair_for_close(void*) (cachetable.cc:2278)

Reproducer:
./mtr --valgrind-mysqld --valgrind-option=--leak-check=full --valgrind-option=--show-reachable=yes --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.alter_table row_format_alter

Possible change to the valgrind.supp file to ignore this bug:
{
   lzma encoder prepare bug
   Memcheck:Cond
   fun:lz_encoder_prepare
   fun:lzma_lz_encoder_init
}

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3415

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers