Corrupt master binary log causing slaves to crash

Hi all

We’ve got a replication master writing corrupt entries into its bin log, which is causing the slaves to crash with the slave i/o thread attempts to read it. Extract from an alert log below (apologies for the wall of text). Has anyone else struck this problem?

130322 12:39:12 [ERROR] Error reading packet from server: log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master ( server_errno=1236)
130322 12:39:12 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: ‘log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master’, Error_code: 1236
130322 12:39:12 [Note] Slave I/O thread exiting, read up to log ‘master-bin.005615’, position 879273433
01:39:13 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at

It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4015154 K bytes of memory
Hope that’s ok; if not, decrease some variables in the equation.

Thread pointer: 0x9790af8
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong…
stack_bottom = 1b8983ac thread_stack 0x30000
/usr/sbin/mysqld(_Z10unpack_rowPK14Relay_log_infoP8st_tablej PKhPK9st_bitmapPS5_Pm+0x267)[0x829e8d7]
/usr/sbin/mysqld(ZN14Rows_log_event8find_rowEPK14Relay_log info+0x28d)[0x829a1dd]
/usr/sbin/mysqld(_ZN21Update_rows_log_event11do_exec_rowEPK1 4Relay_log_info+0x21)[0x829aa31]
/usr/sbin/mysqld(_ZN14Rows_log_event14do_apply_eventEPK14Rel ay_log_info+0x18f)[0x82989af]
/usr/sbin/mysqld(_Z26apply_event_and_update_posP9Log_eventP3 THDP14Relay_log_info+0x114)[0x8303f34]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): is an invalid pointer
Connection ID (thread ID): 920

You may download the Percona Server operations manual by visiting
. You may find information
in the manual which will help you identify the cause of the crash.
130322 12:39:13 mysqld_safe Number of processes running now: 0
130322 12:39:13 mysqld_safe mysqld restarted

Have you checked the value of max_allowed_packet on the master and on the slave?

We’re using 5.1.67 so slave_max_allowed_packet takes care of the slave.

As part of the efforts to resolve this we increased the masters max_allowed_packet from 16mb to 64mb. We haven’t struck the problem since, however because the master binary log is unreadable we have no idea of the statement that caused the problem.

In any case, this issue is focused on slaves crashing on trying to read a corrupt log entry. mysqld shouldn’t crash in that way.