From: leo@yuriev.ru Date: Fri, 17 Oct 2014 22:35:41 +0000 (+0000) Subject: ITS#7970 LMDB: Critical Heisenbug X-Git-Tag: submit/tizen/20180312.054306~290 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd6d2e6f2c157551f1a0b912716ae92f120361f2;p=platform%2Fupstream%2Flmdb.git ITS#7970 LMDB: Critical Heisenbug Inconsistent reading & SIGSEGV due to the race condition. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index c84c07f..0af2047 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2558,7 +2558,10 @@ 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]; }