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
1=== modified file 'storage/innobase/include/lock0lock.h'
2--- storage/innobase/include/lock0lock.h 2014-06-04 14:48:06 +0000
3+++ storage/innobase/include/lock0lock.h 2014-11-14 09:43:56 +0000
4@@ -291,7 +291,7 @@
5 inserted record maybe should inherit
6 LOCK_GAP type locks from the successor
7 record */
8- __attribute__((nonnull, warn_unused_result));
9+ __attribute__((nonnull(2,3,4,6,7), warn_unused_result));
10 /*********************************************************************//**
11 Checks if locks of other transactions prevent an immediate modify (update,
12 delete mark, or delete unmark) of a clustered index record. If they do,
13
14=== modified file 'storage/innobase/include/trx0rec.h'
15--- storage/innobase/include/trx0rec.h 2013-08-06 15:16:34 +0000
16+++ storage/innobase/include/trx0rec.h 2014-11-14 09:43:56 +0000
17@@ -233,7 +233,7 @@
18 inserted undo log record,
19 0 if BTR_NO_UNDO_LOG
20 flag was specified */
21- __attribute__((nonnull(3,4,10), warn_unused_result));
22+ __attribute__((nonnull(4,10), warn_unused_result));
23 /******************************************************************//**
24 Copies an undo record to heap. This function can be called if we know that
25 the undo log record exists.
26
27=== modified file 'storage/innobase/lock/lock0lock.cc'
28--- storage/innobase/lock/lock0lock.cc 2014-09-25 14:16:07 +0000
29+++ storage/innobase/lock/lock0lock.cc 2014-11-14 09:43:56 +0000
30@@ -5959,6 +5959,7 @@
31 ut_ad(!dict_index_is_online_ddl(index)
32 || dict_index_is_clust(index)
33 || (flags & BTR_CREATE_FLAG));
34+ ut_ad((flags & BTR_NO_LOCKING_FLAG) || thr);
35
36 if (flags & BTR_NO_LOCKING_FLAG) {
37

Subscribers

People subscribed via source and target branches