Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4
-
Related to performance
Description
Code Analysis
Log_event::read_log_event(IO_CACHE*, ...) has an assertion saying that error cases should not generate an event:
if (unlikely(error)) |
{
|
DBUG_ASSERT(!res);
|
But a checksum error in Log_event::read_log_event(const uchar *buf, ...) outputs both an error message and, under --force-read, an Unknown_log_event substitute.
MDEV-35643's explicit refute of TRANSACTION_PAYLOAD_EVENT and PARTIAL_UPDATE_ROWS_EVENT events also have the same problematic code pattern.
(This means a perfectly valid MySQL binlog can trigger this bug.)
On non-debug (release) builds that don't include assertions, the snippet immediately after this assertion ends the function without cleaning up the unexpected Unknown_log_event, which is a memory leak.
if (force_opt) |
DBUG_RETURN(new Unknown_log_event()); |
MTR Reproduction
--source include/have_debug.inc
|
--source include/have_binlog_format_mixed.inc # format-agnostic
|
RESET MASTER;
|
FLUSH BINARY LOGS; |
|
|
--let $MYSQLD_DATADIR= `SELECT @@datadir`
|
--echo #MYSQL_BINLOG --verify-binlog-checksum --force-read --debug=d,simulate_checksum_test_failure #MYSQLD_DATADIR/master-bin.000001 2>&1
|
--exec $MYSQL_BINLOG --verify-binlog-checksum --force-read --debug=d,simulate_checksum_test_failure $MYSQLD_DATADIR/master-bin.000001 2>&1 |
Fix Recommendation
Since --force-read is defined as "output invalid events as 'Unknown event's rather than error", the conditions above should output an Unknown_log_event but not an error.
Attachments
Issue Links
- is caused by
-
MDEV-35643 Add support for MySQL 8.0 binlog events
-
- Closed
-
- split from
-
MDEV-40542 MSAN use-of-uninitialized-value on Unknown_log_event::read_checksum_alg
-
- Open
-