Merge lp:~laurynas-biveinis/percona-server/bug1390695 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 694
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1390695
Merge into: lp:percona-server/5.6
Diff against target: 36 lines (+3/-2)
3 files modified
storage/innobase/include/lock0lock.h (+1/-1)
storage/innobase/include/trx0rec.h (+1/-1)
storage/innobase/lock/lock0lock.cc (+1/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1390695
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+241774@code.launchpad.net

Description of the change

Fix bug 1390695 (percona 5.6.21-70.0 crash on data import) by fixing
the upstream bug http://bugs.mysql.com/bug.php?id=74842 (Incorrect
attribute((nonnull)) for btr_cur_ins_lock_and_undo callees)

The crash in the Percona Server bug is happening because a thr != NULL
check after the btr_cur_ins_lock_and_undo call is getting optimized
away, while NULL is a legal value for thr there. The cause for this is
the upstream bug: lock_rec_insert_check_and_lock is incorectly
annotated with attribute((nonnull)), applying to its thr arg. Thus,
after returning from the call, the compiler assumes that thr must be
!= NULL.

Fix by correcting the attribute((nonnull)) annotations for
lock_rec_insert_check_and_lock and trx_undo_report_row_operation not
to say that thr must be nonnull.

http://jenkins.percona.com/job/percona-server-5.6-param/755/

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

No new MTR testcase needed: the bug makes the existing ones (e.g. innodb.innodb) fail.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'storage/innobase/include/lock0lock.h'
--- storage/innobase/include/lock0lock.h 2014-06-04 14:48:06 +0000
+++ storage/innobase/include/lock0lock.h 2014-11-14 09:43:56 +0000
@@ -291,7 +291,7 @@
291 inserted record maybe should inherit291 inserted record maybe should inherit
292 LOCK_GAP type locks from the successor292 LOCK_GAP type locks from the successor
293 record */293 record */
294 __attribute__((nonnull, warn_unused_result));294 __attribute__((nonnull(2,3,4,6,7), warn_unused_result));
295/*********************************************************************//**295/*********************************************************************//**
296Checks if locks of other transactions prevent an immediate modify (update,296Checks if locks of other transactions prevent an immediate modify (update,
297delete mark, or delete unmark) of a clustered index record. If they do,297delete mark, or delete unmark) of a clustered index record. If they do,
298298
=== modified file 'storage/innobase/include/trx0rec.h'
--- storage/innobase/include/trx0rec.h 2013-08-06 15:16:34 +0000
+++ storage/innobase/include/trx0rec.h 2014-11-14 09:43:56 +0000
@@ -233,7 +233,7 @@
233 inserted undo log record,233 inserted undo log record,
234 0 if BTR_NO_UNDO_LOG234 0 if BTR_NO_UNDO_LOG
235 flag was specified */235 flag was specified */
236 __attribute__((nonnull(3,4,10), warn_unused_result));236 __attribute__((nonnull(4,10), warn_unused_result));
237/******************************************************************//**237/******************************************************************//**
238Copies an undo record to heap. This function can be called if we know that238Copies an undo record to heap. This function can be called if we know that
239the undo log record exists.239the undo log record exists.
240240
=== modified file 'storage/innobase/lock/lock0lock.cc'
--- storage/innobase/lock/lock0lock.cc 2014-09-25 14:16:07 +0000
+++ storage/innobase/lock/lock0lock.cc 2014-11-14 09:43:56 +0000
@@ -5959,6 +5959,7 @@
5959 ut_ad(!dict_index_is_online_ddl(index)5959 ut_ad(!dict_index_is_online_ddl(index)
5960 || dict_index_is_clust(index)5960 || dict_index_is_clust(index)
5961 || (flags & BTR_CREATE_FLAG));5961 || (flags & BTR_CREATE_FLAG));
5962 ut_ad((flags & BTR_NO_LOCKING_FLAG) || thr);
59625963
5963 if (flags & BTR_NO_LOCKING_FLAG) {5964 if (flags & BTR_NO_LOCKING_FLAG) {
59645965

Subscribers

People subscribed via source and target branches