[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#7970) LMDB: Critical Heisenbug - Inconsistent reading & SIGSEGV due to the race condition.
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#7970) LMDB: Critical Heisenbug - Inconsistent reading & SIGSEGV due to the race condition.
- From: hyc@symas.com
- Date: Sat, 18 Oct 2014 06:14:44 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Committed to mdb.master
> commit 6028662665c09f4d34b751bfd9b09223f6cb2433
> Author: Leo Yuriev <leo@yuriev.ru>
> Date: 2014-10-17 23:29:56 +0400
>
> ITS#7970 for LMDB: the Heisenbug.
>
> diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
> index 3286ffb..83a15c1 100644
> --- a/libraries/liblmdb/mdb.c
> +++ b/libraries/liblmdb/mdb.c
> @@ -2522,7 +2522,12 @@ mdb_txn_renew0(MDB_txn *txn)
> return rc;
> }
> }
> - txn->mt_txnid = r->mr_txnid = ti->mti_txnid;
> +
> + do /* LY: Retry on a race, ITS#7970. */
> + r->mr_txnid = ti->mti_txnid;
> + while(r->mr_txnid != ti->mti_txnid);
> +
> + txn->mt_txnid = r->mr_txnid;
> txn->mt_u.reader = r;
> meta = env->me_metas[txn->mt_txnid & 1];
> }
>
>
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/