projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a80a8a
)
ITS#7970 LMDB: Critical Heisenbug
author
leo@yuriev.ru
<leo@yuriev.ru>
Fri, 17 Oct 2014 22:35:41 +0000
(22:35 +0000)
committer
Howard Chu
<hyc@symas.com>
Sat, 18 Oct 2014 05:57:58 +0000
(06:57 +0100)
Inconsistent reading & SIGSEGV due to the race condition.
libraries/liblmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/liblmdb/mdb.c
b/libraries/liblmdb/mdb.c
index c84c07f04239adf48268b6ce1853f3a764db66f9..0af2047cff83511c0031542b97df7199dd87430c 100644
(file)
--- 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];
}