[MDEV-29439] MSAN use-of-unitialized-value errors in Query_log_event::do_apply_event Created: 2022-09-01  Updated: 2022-11-10  Resolved: 2022-11-10

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.5.18, 10.6.10, 10.7.6, 10.8.5, 10.9.3

Type: Bug Priority: Major
Reporter: Angelique Sklavounos (Inactive) Assignee: Andrei Elkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-29322 ASAN heap-use-after-free in Query_log... Closed

 Description   

https://buildbot.mariadb.org/#/builders/348/builds/2111

10.6 dacd42496

rpl.rpl_mdev10863 'innodb,mix'           w28 [ fail ]
        Test ended at 2022-08-15 04:42:51
 
CURRENT_TEST: rpl.rpl_mdev10863
mysqltest: At line 51: failed in 'select master_pos_wait('master-bin.000001', 64175, 300, '')': 2013: Lost connection to server during query

==120613==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x564375a3d782 in THD::reset_for_next_command(bool) /buildbot/amd64-ubuntu-2004-msan/build/sql/sql_parse.cc:7586:7
    #1 0x564375a37100 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /buildbot/amd64-ubuntu-2004-msan/build/sql/sql_parse.cc:7976:8
    #2 0x564376cc749e in Query_log_event::do_apply_event(rpl_group_info*, char const*, unsigned int) /buildbot/amd64-ubuntu-2004-msan/build/sql/log_event_server.cc:1919:9
    #3 0x5643756a07ec in Log_event::apply_event(rpl_group_info*) /buildbot/amd64-ubuntu-2004-msan/build/sql/log_event.h:1499:10
    #4 0x56437567a62d in apply_event_and_update_pos_apply(Log_event*, THD*, rpl_group_info*, int) /buildbot/amd64-ubuntu-2004-msan/build/sql/slave.cc:3881:19
    #5 0x56437626ff93 in rpt_handle_event(rpl_parallel_thread::queued_event*, rpl_parallel_thread*) /buildbot/amd64-ubuntu-2004-msan/build/sql/rpl_parallel.cc:62:8
    #6 0x5643762640f6 in handle_rpl_parallel_thread /buildbot/amd64-ubuntu-2004-msan/build/sql/rpl_parallel.cc:1378:18
    #7 0x56437749de5a in pfs_spawn_thread /buildbot/amd64-ubuntu-2004-msan/build/storage/perfschema/pfs.cc:2201:3
    #8 0x7ff914d21608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477:8
    #9 0x7ff9148d7292 in clone /build/glibc-eX1tMB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
 
  Uninitialized value was stored to memory at
    #0 0x564376cc84ef in Query_log_event::do_apply_event(rpl_group_info*, char const*, unsigned int) /buildbot/amd64-ubuntu-2004-msan/build/sql/log_event_server.cc:1732:35
 
  Uninitialized value was created by a heap deallocation
    #0 0x564375520da9 in free (/buildbot/amd64-ubuntu-2004-msan/build/sql/mariadbd+0x7f5da9)
    #1 0x5643786fe710 in my_free /buildbot/amd64-ubuntu-2004-msan/build/mysys/my_malloc.c:211:3
 
SUMMARY: MemorySanitizer: use-of-uninitialized-value /buildbot/amd64-ubuntu-2004-msan/build/sql/sql_parse.cc:7586:7 in THD::reset_for_next_command(bool)

The first occurrence appears to be https://buildbot.mariadb.org/#/builders/348/builds/1862



 Comments   
Comment by Angelique Sklavounos (Inactive) [ 2022-11-10 ]

Based on the traceback and the timings of the failures, I believe this was related to MDEV-29322 and resolved by the fix there.

Generated at Thu Feb 08 10:08:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.