[Date Prev][Date Next]
(ITS#7969) LMDB: Globally shared fields of meta-data are not 'volatile'.
- To: openldap-its@OpenLDAP.org
- Subject: (ITS#7969) LMDB: Globally shared fields of meta-data are not 'volatile'.
- From: firstname.lastname@example.org
- Date: Fri, 17 Oct 2014 22:19:21 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Full_Name: Leonid Yuriev
Submission from: (NULL) (188.8.131.52)
Several fields from the meta-data that shared globally across active writer and
all readers are not 'volatile'. This allow compiler to cache its values in
registers and reorder writes.
More over, in some cases compiler is free to eliminate the calls of function
which seems to be 'const' or 'pure', pls see http://lwn.net/Articles/285332/.
Thereby a series of Heisenbugs may be induced, for instance:
1) The mdb_find_oldest() calls may be potentially eliminated up to public (not
static) functions due to interprocedural optimization 'unit at once'.
2) Reordering of CPU instructions which updates the txn in a meta-page. Without
"volatile" or memory-barrier compiler may reorder instructions for update the
"mm_txnid" field in meta-page in "writemap" mode.
Thereby, from the reader's point of view this cause a short time interval when
the transaction is corrupted.
On some architectures few actions are required for cache coherence, for instance
- GCC's __synchronize() must be called.
3) A really critical bugs will be described later in separate ITS.