mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:24:12 +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;
|
||||
mdbx_meta_update_begin(env, target, pending->mm_txnid_a);
|
||||
#ifndef NDEBUG
|
||||
/* debug: provoke failure to catch a violators */
|
||||
memset(target->mm_dbs, 0xCC,
|
||||
sizeof(target->mm_dbs) + sizeof(target->mm_canary));
|
||||
/* debug: provoke failure to catch a violators, but don't touch mm_psize
|
||||
* and mm_flags to allow readers catch actual pagesize. */
|
||||
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);
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user