• Sujatha's avatar
    MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events · a6dd827a
    Sujatha authored
    Problem:
    ========
    SHOW BINLOG EVENTS FROM <pos> causes a variety of failures, some of which are
    listed below. It is not a race condition issue, but there is some
    non-determinism in it.
    
    Analysis:
    ========
    "show binlog events from <pos>" code considers the user given position as a
    valid event start position. The code starts reading data from this event start
    position onwards and tries to map it to a set of known events. Each event has
    a specific event structure and asserts have been added to ensure that read
    event data satisfies the event specific requirements. When a random position
    is supplied to "show binlog events command" the event structure specific
    checks will fail and they result in assert.
    
    Fix:
    ====
    The fix is split into different parts. Each part addresses either an ASAN
    issue or an assert/crash.
    
    **Part1: Checksum based position validation when checksum is enabled**
    
    
    Using checksum validate the very first event read at the user specified
    position. If there is a checksum mismatch report an appropriate error for the
    invalid event.
    a6dd827a
binlog_invalid_read_in_rotate.combinations 74 Bytes