[MDEV-11673] binlog_encryption.rpl_semi_sync fails with valgrind (Conditional jump or move depends on uninitialised value) Created: 2016-12-27  Updated: 2023-04-17

Status: Stalled
Project: MariaDB Server
Component/s: Encryption, Replication, Tests
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-7069 Fix buildbot failures in main server ... Stalled

 Description   

Stack trace from 10.1 545c91269

binlog_encryption.rpl_semi_sync 'innodb_plugin,mix' [ fail ]  Found warnings/errors in server log file!
        Test ended at 2016-12-27 18:31:55
line
==25477== Thread 26:
==25477== Conditional jump or move depends on uninitialised value(s)
==25477==    at 0x60BCBE: send_events(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2680)
==25477==    by 0x60C052: send_one_binlog_file(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2762)
==25477==    by 0x60C457: mysql_binlog_send(THD*, char*, unsigned long long, unsigned short) (sql_repl.cc:2885)
==25477==    by 0x5D4BBD: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1724)
==25477==    by 0x5D2CD3: do_command(THD*) (sql_parse.cc:1108)
==25477==    by 0x70921C: do_handle_one_connection(THD*) (sql_connect.cc:1350)
==25477==    by 0x708F80: handle_one_connection (sql_connect.cc:1262)
==25477==    by 0x9EC59B: pfs_spawn_thread (pfs.cc:1860)
==25477==    by 0x4E3D0A3: start_thread (pthread_create.c:309)
==25477==    by 0x6CB787C: clone (clone.S:111)

==25477== Conditional jump or move depends on uninitialised value(s)
==25477==    at 0x608CC5: gtid_state_from_pos(char const*, unsigned int, slave_connection_state*) (sql_repl.cc:1462)
==25477==    by 0x609287: gtid_state_from_binlog_pos(char const*, unsigned int, String*) (sql_repl.cc:1609)
==25477==    by 0x8A6DBC: Item_func_binlog_gtid_pos::val_str(String*) (item_strfunc.cc:3093)
==25477==    by 0x833660: Item::send(Protocol*, String*) (item.cc:6475)
==25477==    by 0x520BA5: Protocol::send_result_set_row(List<Item>*) (protocol.cc:914)
==25477==    by 0x59897F: select_send::send_data(List<Item>&) (sql_class.cc:2829)
==25477==    by 0x619339: JOIN::exec_inner() (sql_select.cc:2584)
==25477==    by 0x618DB6: JOIN::exec() (sql_select.cc:2505)
==25477==    by 0x61C334: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3439)
==25477==    by 0x611E15: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:384)
==25477==    by 0x5E1E5D: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5896)
==25477==    by 0x5D7D7F: mysql_execute_command(THD*) (sql_parse.cc:2968)

...
Also happens in buildbot with slightly different stack:
http://buildbot.askmonty.org/buildbot/builders/xenial-amd64-valgrind/builds/233/steps/test/logs/stdio

binlog_encryption.rpl_semi_sync 'innodb_plugin,mix' w19 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2016-12-26 23:21:20
line
==1446== Thread 26:
==1446== Conditional jump or move depends on uninitialised value(s)
==1446==    at 0x5692CB: String::c_ptr() (sql_string.h:182)
==1446==    by 0x71AF3E: Binlog_transmit_delegate::before_send_event(THD*, unsigned short, String*, char const*, unsigned long long) (rpl_handler.cc:374)
==1446==    by 0x60E99D: send_event_to_slave(binlog_send_info*, Log_event_type, st_io_cache*, unsigned long, rpl_gtid*) (sql_repl.cc:1985)
==1446==    by 0x6107D0: send_events(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2681)
==1446==    by 0x610B32: send_one_binlog_file(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2762)
==1446==    by 0x610F38: mysql_binlog_send(THD*, char*, unsigned long long, unsigned short) (sql_repl.cc:2885)
==1446==    by 0x5D8910: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1724)
==1446==    by 0x5D6A14: do_command(THD*) (sql_parse.cc:1108)
==1446==    by 0x712ABE: do_handle_one_connection(THD*) (sql_connect.cc:1350)
==1446==    by 0x71280D: handle_one_connection (sql_connect.cc:1262)
==1446==    by 0xA0E4F9: pfs_spawn_thread (pfs.cc:1860)
==1446==    by 0x64056B9: start_thread (pthread_create.c:333)



 Comments   
Comment by Elena Stepanova [ 2017-05-08 ]

Rcent occurrence on 10.2:
http://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/10030/steps/test/logs/stdio

Comment by Alice Sherepa [ 2019-04-29 ]

still reproducible, 10.1 021c7216c05f3143c5113

binlog_encryption.rpl_semi_sync 'innodb_plugin,mix' w4 [ fail ]  Found warnings/errors in server log file!
        Test ended at 2019-04-29 12:56:28
line
==18748== Thread 26:
==18748== Conditional jump or move depends on uninitialised value(s)
==18748==    at 0x570F61: String::c_ptr() (sql_string.h:182)
==18748==    by 0x729A16: Binlog_transmit_delegate::before_send_event(THD*, unsigned short, String*, char const*, unsigned long long) (rpl_handler.cc:374)
==18748==    by 0x617D3C: send_event_to_slave(binlog_send_info*, Log_event_type, st_io_cache*, unsigned long, rpl_gtid*) (sql_repl.cc:1916)
==18748==    by 0x619B81: send_events(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2613)
==18748==    by 0x619EE3: send_one_binlog_file(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2694)
==18748==    by 0x61A2E9: mysql_binlog_send(THD*, char*, unsigned long long, unsigned short) (sql_repl.cc:2817)
==18748==    by 0x5E1BC7: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1741)
==18748==    by 0x5DFD17: do_command(THD*) (sql_parse.cc:1131)
==18748==    by 0x721544: do_handle_one_connection(THD*) (sql_connect.cc:1330)
==18748==    by 0x721293: handle_one_connection (sql_connect.cc:1242)
==18748==    by 0xE7D8F9: pfs_spawn_thread (pfs.cc:1861)
==18748==    by 0x5F006B9: start_thread (pthread_create.c:333)
==18748==    by 0x68A841C: clone (clone.S:109)
^ Found warnings in /git/10.1/mysql-test/var/4/log/mysqld.1.err

Comment by Elena Stepanova [ 2019-12-11 ]

10.3 e5e58777

binlog_encryption.binlog_row_annotate 'cmpr' [ fail ]  Found warnings/errors in server log file!
        Test ended at 2019-12-11 15:12:07
line
==27849== Thread 29:
==27849== Conditional jump or move depends on uninitialised value(s)
==27849==    at 0x6F1EF4: String::c_ptr() (sql_string.h:206)
==27849==    by 0x818F6E: send_event_to_slave(binlog_send_info*, Log_event_type, st_io_cache*, unsigned long, rpl_gtid*) (sql_repl.cc:1961)
==27849==    by 0x81B069: send_events(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2664)
==27849==    by 0x81B48B: send_one_binlog_file(binlog_send_info*, st_io_cache*, st_log_info*, unsigned long long) (sql_repl.cc:2745)
==27849==    by 0x81B915: mysql_binlog_send(THD*, char*, unsigned long long, unsigned short) (sql_repl.cc:2872)
==27849==    by 0x7DA82B: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:2108)
==27849==    by 0x7D846E: do_command(THD*) (sql_parse.cc:1401)
==27849==    by 0x95564D: do_handle_one_connection(CONNECT*) (sql_connect.cc:1403)
==27849==    by 0x9553AF: handle_one_connection (sql_connect.cc:1308)
==27849==    by 0x1358D6D: pfs_spawn_thread (pfs.cc:1862)
==27849==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==27849==    by 0x6938D0E: clone (clone.S:97)
^ Found warnings in /data/bld/10.3-valgrind/mysql-test/var/log/mysqld.1.err

Comment by Elena Stepanova [ 2019-12-11 ]

10.4 doesn't seem to produce "Conditional jump or move", only "blocks are still reachable"

10.4 9a621200

binlog_encryption.binlog_row_annotate 'cmpr' [ pass ]   2616
***Warnings generated in error logs during shutdown after running tests: binlog_encryption.binlog_row_annotate
 
==20451== 112 bytes in 1 blocks are still reachable in loss record 3 of 7
==20451==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==20451==    by 0xFD1555: os_event_create(char const*) (os0event.cc:429)
==20451==    by 0x110BB70: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:235)
==20451==    by 0x10F7426: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:522)
==20451==    by 0x10FD471: srv_purge_coordinator_thread (srv0srv.cc:2726)
==20451==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==20451==    by 0x6938D0E: clone (clone.S:97)
==20451== 112 bytes in 1 blocks are still reachable in loss record 4 of 7
==20451==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==20451==    by 0xFD1555: os_event_create(char const*) (os0event.cc:429)
==20451==    by 0x110BB85: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:236)
==20451==    by 0x10F7426: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:522)
==20451==    by 0x10FD471: srv_purge_coordinator_thread (srv0srv.cc:2726)
==20451==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==20451==    by 0x6938D0E: clone (clone.S:97)
==20451== 336 bytes in 3 blocks are still reachable in loss record 6 of 7
==20451==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==20451==    by 0xFD1555: os_event_create(char const*) (os0event.cc:429)
==20451==    by 0x110BB70: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:235)
==20451==    by 0x10F7426: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:522)
==20451==    by 0x10FCC4F: srv_worker_thread (srv0srv.cc:2504)
==20451==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==20451==    by 0x6938D0E: clone (clone.S:97)
==20451== 336 bytes in 3 blocks are still reachable in loss record 7 of 7
==20451==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==20451==    by 0xFD1555: os_event_create(char const*) (os0event.cc:429)
==20451==    by 0x110BB85: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:236)
==20451==    by 0x10F7426: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:522)
==20451==    by 0x10FCC4F: srv_worker_thread (srv0srv.cc:2504)
==20451==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==20451==    by 0x6938D0E: clone (clone.S:97)

It is filed as MDEV-21236.

Generated at Thu Feb 08 07:51:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.