Bug #89509 Valgrind error on innodb.blob_page_reserve, bundled zlib
Submitted: 2 Feb 9:06 Modified: 9 Feb 20:42
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.4 OS:Any
Assigned to: CPU Architecture:Any
Tags: mtr, valgrind, zlib

[2 Feb 9:06] Laurynas Biveinis
Description:
nnodb.blob_page_reserve                 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2018-02-02 11:02:41
line
==2266== Thread 28:
==2266== Conditional jump or move depends on uninitialised value(s)
==2266==    at 0x400EEC2: slide_hash (deflate.c:219)
==2266==    by 0x4011F05: fill_window (deflate.c:1516)
==2266==    by 0x4012B02: deflate_fast (deflate.c:1838)
==2266==    by 0x40110C5: deflate (deflate.c:1000)
==2266==    by 0x3E46EF7: lob::z_insert_chunk(dict_index_t*, lob::z_first_page_t&, trx_t*, lob::ref_t, unsigned char*, unsigned long, lob::z_index_entry_t*, mtr_t*, bool) (lob0impl.cc:367)
==2266==    by 0x3E475D1: lob::z_insert(lob::InsertContext*, trx_t*, lob::ref_t&, big_rec_field_t*, unsigned long) (lob0impl.cc:468)
==2266==    by 0x3A67102: lob::btr_store_big_rec_extern_fields(trx_t*, btr_pcur_t*, upd_t const*, unsigned long*, big_rec_t const*, mtr_t*, lob::opcode) (lob0lob.cc:463)
==2266==    by 0x3B4A6FA: row_ins_index_entry_big_rec_func(trx_t*, dtuple_t const*, big_rec_t const*, unsigned long*, mem_block_info_t**, THD const*, dict_index_t*) (row0ins.cc:2560)
==2266==    by 0x3B4B546: row_ins_clust_index_entry_low(unsigned long, unsigned long, dict_index_t*, unsigned long, dtuple_t*, unsigned long, que_thr_t*, bool) (row0ins.cc:2852)
==2266==    by 0x3B4D359: row_ins_clust_index_entry(dict_index_t*, dtuple_t*, que_thr_t*, unsigned long, bool) (row0ins.cc:3506)
==2266==    by 0x3B4D86C: row_ins_index_entry(dict_index_t*, dtuple_t*, que_thr_t*) (row0ins.cc:3652)
==2266==    by 0x3B4DE78: row_ins_index_entry_step(ins_node_t*, que_thr_t*) (row0ins.cc:3809)
==2266==    by 0x3B4E226: row_ins(ins_node_t*, que_thr_t*) (row0ins.cc:3951)
==2266==    by 0x3B4E862: row_ins_step(que_thr_t*) (row0ins.cc:4135)
==2266==    by 0x3B6D0CB: row_insert_for_mysql_using_ins_graph(unsigned char const*, row_prebuilt_t*) (row0mysql.cc:1721)
==2266==    by 0x3B6D776: row_insert_for_mysql(unsigned char const*, row_prebuilt_t*) (row0mysql.cc:1859)
^ Found warnings in /home/laurynas/obj-mysql-8.0.4-valgrind/mysql-test/var/log/mysqld.1.err

How to repeat:
-DWITH_VALGRIND=ON -DWITH_ZLIB=bundled (I have not tested "system" due to bug 89373)

./mtr --debug-server --big-test --valgrind innodb.blob_page_reserve
[2 Feb 9:30] Umesh Shastry
Hello Laurynas,

Thank you for the report and feedback.

Thanks,
Umesh
[2 Feb 9:32] Umesh Shastry
-- 8.0.4
-- OL7, gcc (GCC) 4.8.3

cmake . -DWITH_DEBUG=ON -DWITH_VALGRIND=ON -DWITH_ZLIB=bundled -DWITH_BOOST=./boost
make -j24

[umshastr@hod03]/export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc: cd mysql-test/
[umshastr@hod03]/export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test: ./mtr --debug-server --big-test --valgrind innodb.blob_page_reserve
Logging: ./mtr  --debug-server --big-test --valgrind innodb.blob_page_reserve
2018-02-02T09:18:31.190319Z 0 [System] [MY-010116] /export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/runtime_output_directory/mysqld (mysqld 8.0.4-rc-debug-log-valgrind) starting as process 19020 ...
MySQL Version 8.0.4
Turning on valgrind for all executables
Running valgrind with options " --tool=memcheck --num-callers=16 --show-reachable=yes --suppressions=/export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test/valgrind.supp "
Turning off --check-testcases to save time when valgrinding
Checking supported features...
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
Checking leftover processes...
Removing old var directory...
Creating var directory '/export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test/var'...
Installing system database...
Using parallel: 1

==============================================================================

TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
innodb.blob_page_reserve                 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2018-02-02 10:28:32
line
==19092== Thread 28:
==19092== Conditional jump or move depends on uninitialised value(s)
==19092==    at 0x3F544DC: slide_hash (deflate.c:219)
==19092==    by 0x3F574E7: fill_window (deflate.c:1516)
==19092==    by 0x3F580D8: deflate_fast (deflate.c:1838)
==19092==    by 0x3F566C1: deflate (deflate.c:1000)
==19092==    by 0x3D45CCD: lob::z_insert_chunk(dict_index_t*, lob::z_first_page_t&, trx_t*, lob::ref_t, unsigned char*, unsigned long, lob::z_index_entry_t*, mtr_t*, bool) (lob0impl.cc:367)
==19092==    by 0x3D462DB: lob::z_insert(lob::InsertContext*, trx_t*, lob::ref_t&, big_rec_field_t*, unsigned long) (lob0impl.cc:469)
==19092==    by 0x399D460: lob::btr_store_big_rec_extern_fields(trx_t*, btr_pcur_t*, upd_t const*, unsigned long*, big_rec_t const*, mtr_t*, lob::opcode) (lob0lob.cc:464)
==19092==    by 0x3A74FCE: row_ins_index_entry_big_rec_func(trx_t*, dtuple_t const*, big_rec_t const*, unsigned long*, mem_block_info_t**, THD const*, dict_index_t*) (row0ins.cc:2562)
==19092==    by 0x3A75D36: row_ins_clust_index_entry_low(unsigned long, unsigned long, dict_index_t*, unsigned long, dtuple_t*, unsigned long, que_thr_t*, bool) (row0ins.cc:2852)
==19092==    by 0x3A779AB: row_ins_clust_index_entry(dict_index_t*, dtuple_t*, que_thr_t*, unsigned long, bool) (row0ins.cc:3508)
==19092==    by 0x3A77EAA: row_ins_index_entry(dict_index_t*, dtuple_t*, que_thr_t*) (row0ins.cc:3652)
==19092==    by 0x3A78463: row_ins_index_entry_step(ins_node_t*, que_thr_t*) (row0ins.cc:3809)
==19092==    by 0x3A787EE: row_ins(ins_node_t*, que_thr_t*) (row0ins.cc:3951)
==19092==    by 0x3A78E16: row_ins_step(que_thr_t*) (row0ins.cc:4135)
==19092==    by 0x3A95C71: row_insert_for_mysql_using_ins_graph(unsigned char const*, row_prebuilt_t*) (row0mysql.cc:1721)
==19092==    by 0x3A96284: row_insert_for_mysql(unsigned char const*, row_prebuilt_t*) (row0mysql.cc:1859)
^ Found warnings in /export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test/var/log/mysqld.1.err
ok

 - the logfile can be found in '/export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test/var/log/innodb.blob_page_reserve/blob_page_reserve.log'
worker[1] Valgrind report from /export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test/var/log/mysqld.1.err after tests:
 innodb.blob_page_reserve
--------------------------------------------------------------------------
HEAP SUMMARY:
    in use at exit: 9,248 bytes in 5 blocks
  total heap usage: 1,184,669 allocs, 1,184,664 frees, 970,427,428 bytes allocated

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 0 bytes in 0 blocks
        suppressed: 9,248 bytes in 5 blocks

For counts of detected and suppressed errors, rerun with: -v
Use --track-origins=yes to see where uninitialised values come from
ERROR SUMMARY: 6083980 errors from 1 contexts (suppressed: 2 from 2)
safe_process[19091]: Child process: 19092, exit: 42

valgrind_report                          [ fail ]
        Test ended at 2018-02-02 10:28:32

Valgrind reported failures at shutdown, see above

--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 0.000 of 601 seconds executing testcases
mysql-test-run: WARNING: Got errors/warnings while running tests, please examine '/export/umesh/server/source/bugs/src_build/89438/mysql-8.0.4-rc/mysql-test/var/log/warnings' for details.

Completed: Failed 2/2 tests, 0.00% were successful.

Failing test(s): valgrind_report innodb.blob_page_reserve

The log files in var/log may give you some hint of what went wrong.

If you want to report this error, please read first the documentation
at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html

mysql-test-run: *** ERROR: there were failing test cases
[9 Feb 20:42] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.5 release, and here's the changelog entry:

An invalid zlib-related Valgrind failure reported that a conditional jump
or move depends on uninitialized value.