mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-21 18:08:21 +08:00
mdbx: don't touch mm_psize
and mm_flags
while provoking bad readers (debug-only).
This commit is contained in:
parent
8364427d02
commit
f58185afa6
@ -4914,9 +4914,11 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags,
|
|||||||
target->mm_datasync_sign = MDBX_DATASIGN_WEAK;
|
target->mm_datasync_sign = MDBX_DATASIGN_WEAK;
|
||||||
mdbx_meta_update_begin(env, target, pending->mm_txnid_a);
|
mdbx_meta_update_begin(env, target, pending->mm_txnid_a);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
/* debug: provoke failure to catch a violators */
|
/* debug: provoke failure to catch a violators, but don't touch mm_psize
|
||||||
memset(target->mm_dbs, 0xCC,
|
* and mm_flags to allow readers catch actual pagesize. */
|
||||||
sizeof(target->mm_dbs) + sizeof(target->mm_canary));
|
uint8_t *provoke_begin = (uint8_t *)&target->mm_dbs[FREE_DBI].md_root;
|
||||||
|
uint8_t *provoke_end = (uint8_t *)&target->mm_datasync_sign;
|
||||||
|
memset(provoke_begin, 0xCC, provoke_end - provoke_begin);
|
||||||
mdbx_jitter4testing(false);
|
mdbx_jitter4testing(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user