• unknown's avatar
    BUG#30752 rpl_dual_pos_advance valgrind (jump depends on uninitialized LOG_INFO) · 8d7af8f0
    unknown authored
    Problem: one thread could read uninitialized memory from (the stack of) another
    thread.
    Fix: swapped order of initializing the memory and making it available to the
    other thread.
    Fix: put lock around the statement that makes the memory available to the other
    thread.
    Fix: all fields of the struct are now initialized in the constructor, to avoid
    future problems.
    
    
    sql/sql_class.h:
      Initialize all members in constructor for more safe future code.
    sql/sql_repl.cc:
      Swap order so that linfo is first initialized, then assigned, instead of the
      other way around.
      Put a lock around the assignment. We use LOCK_thread_count since log_in_use
      uses it: log_in_use may be running concurrently, called from
      MYSQL_LOG::purge_logs.
    8d7af8f0
sql_repl.cc 46.5 KB