{"action":"created","issue":{"url":"https://api.github.com/repos/percona/percona-server/issues/113","labels_url":"https://api.github.com/repos/percona/percona-server/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/percona/percona-server/issues/113/comments","events_url":"https://api.github.com/repos/percona/percona-server/issues/113/events","html_url":"https://github.com/percona/percona-server/pull/113","id":94305228,"number":113,"title":"Bug #1464468 fix. Slave crash with malformed binlog event","user":{"login":"vlad-lesin","id":5470252,"avatar_url":"https://avatars.githubusercontent.com/u/5470252?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad-lesin","html_url":"https://github.com/vlad-lesin","followers_url":"https://api.github.com/users/vlad-lesin/followers","following_url":"https://api.github.com/users/vlad-lesin/following{/other_user}","gists_url":"https://api.github.com/users/vlad-lesin/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad-lesin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad-lesin/subscriptions","organizations_url":"https://api.github.com/users/vlad-lesin/orgs","repos_url":"https://api.github.com/users/vlad-lesin/repos","events_url":"https://api.github.com/users/vlad-lesin/events{/privacy}","received_events_url":"https://api.github.com/users/vlad-lesin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"laurynas-biveinis","id":58894,"avatar_url":"https://avatars.githubusercontent.com/u/58894?v=3","gravatar_id":"","url":"https://api.github.com/users/laurynas-biveinis","html_url":"https://github.com/laurynas-biveinis","followers_url":"https://api.github.com/users/laurynas-biveinis/followers","following_url":"https://api.github.com/users/laurynas-biveinis/following{/other_user}","gists_url":"https://api.github.com/users/laurynas-biveinis/gists{/gist_id}","starred_url":"https://api.github.com/users/laurynas-biveinis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurynas-biveinis/subscriptions","organizations_url":"https://api.github.com/users/laurynas-biveinis/orgs","repos_url":"https://api.github.com/users/laurynas-biveinis/repos","events_url":"https://api.github.com/users/laurynas-biveinis/events{/privacy}","received_events_url":"https://api.github.com/users/laurynas-biveinis/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-07-10T13:16:06Z","updated_at":"2015-07-20T09:01:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/percona/percona-server/pulls/113","html_url":"https://github.com/percona/percona-server/pull/113","diff_url":"https://github.com/percona/percona-server/pull/113.diff","patch_url":"https://github.com/percona/percona-server/pull/113.patch"},"body":"See\r\n\r\nhttps://bugs.launchpad.net/percona-server/+bug/1464468/comments/1\r\nhttps://bugs.launchpad.net/percona-server/+bug/1464468/comments/2\r\n\r\nfor details.\r\n\r\nThe fix is in clearing the number of binlog table maps in\r\nbinlog_cache_data::flush_pending_event() even if the number\r\nof pending events is zero.\r\n\r\nThere is the following call stack.\r\n\r\nwrite_locked_table_maps()-(as thd->binlog_table_maps is 0)->binlog_start_trans_and_stmt()->THD::binlog_write_table_map->register_binlog_handler()\r\n\r\nIf thd->binlog_table_maps is not zero then binlog handlerton is not registered\r\nand the following ha_savepoint() call will not initialize memory where\r\nsavepoint binlog position is stored what leads to storing uninitialized value\r\nin binlog_cache_data::cache_log.pos_in_file on ha_rollback_to_savepoint()\r\nexecution and damaging binary log file.\r\n\r\nhttp://jenkins.percona.com/view/PS%205.6/job/percona-server-5.6-param/884/"},"comment":{"url":"https://api.github.com/repos/percona/percona-server/issues/comments/122817090","html_url":"https://github.com/percona/percona-server/pull/113#issuecomment-122817090","issue_url":"https://api.github.com/repos/percona/percona-server/issues/113","id":122817090,"user":{"login":"laurynas-biveinis","id":58894,"avatar_url":"https://avatars.githubusercontent.com/u/58894?v=3","gravatar_id":"","url":"https://api.github.com/users/laurynas-biveinis","html_url":"https://github.com/laurynas-biveinis","followers_url":"https://api.github.com/users/laurynas-biveinis/followers","following_url":"https://api.github.com/users/laurynas-biveinis/following{/other_user}","gists_url":"https://api.github.com/users/laurynas-biveinis/gists{/gist_id}","starred_url":"https://api.github.com/users/laurynas-biveinis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurynas-biveinis/subscriptions","organizations_url":"https://api.github.com/users/laurynas-biveinis/orgs","repos_url":"https://api.github.com/users/laurynas-biveinis/repos","events_url":"https://api.github.com/users/laurynas-biveinis/events{/privacy}","received_events_url":"https://api.github.com/users/laurynas-biveinis/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T09:01:14Z","updated_at":"2015-07-20T09:01:14Z","body":"Vlad - \r\n\r\nthe second comment on the bug explains why this fix works on the testcase, but what I had in mind is that I could not figure out whether clearing table maps unconditionally is safe outside this bug as well.\r\n\r\nRe. whether it's the same bug or not, please consider the following: before any fix is applied, the original 1438990/76727 testcase crashes the slave in unpack_row, and the testcase for the current bug crashes with the same stacktrace. If the fix for 1438990 is applied, the 1438990 testcase passes, and the current bug testcase crashes master debug build or breaks replication for release build. I'd conclude that 1464468 fix is what makes 1438990 fix complete and should be considered its part.\r\n\r\nIf you think that your fix is safe in general, outside what's discussed in comment 2, go ahead with the original fix. Re. the testcases, again, up to you. Re. showing binlog events, no of course that is not required to verify the fix, it just helps with understanding how this case should work.\r\n\r\n"}}