mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 03:04:12 +08:00
mdbx: fix ASAN-regression after 1740043678951c5a1a088e6572722de438162ab2.
Related to https://github.com/erthink/libmdbx/issues/217
This commit is contained in:
parent
6034985686
commit
d67b9eaf17
@ -11642,13 +11642,17 @@ __cold static int mdbx_setup_dxb(MDBX_env *env, const int lck_rc,
|
||||
mdbx_assert(env, used_bytes >= pgno2bytes(env, NUM_METAS) &&
|
||||
used_bytes <= env->me_dxb_mmap.limit);
|
||||
#if defined(MDBX_USE_VALGRIND) || defined(__SANITIZE_ADDRESS__)
|
||||
if (env->me_dxb_mmap.filesize > used_bytes) {
|
||||
if (env->me_dxb_mmap.filesize > used_bytes &&
|
||||
env->me_dxb_mmap.filesize < env->me_dxb_mmap.limit) {
|
||||
VALGRIND_MAKE_MEM_NOACCESS(env->me_map + used_bytes,
|
||||
env->me_dxb_mmap.filesize - used_bytes);
|
||||
MDBX_ASAN_POISON_MEMORY_REGION(env->me_map + used_bytes,
|
||||
env->me_dxb_mmap.filesize - used_bytes);
|
||||
}
|
||||
env->me_poison_edge = bytes2pgno(env, env->me_dxb_mmap.filesize);
|
||||
env->me_poison_edge =
|
||||
bytes2pgno(env, (env->me_dxb_mmap.filesize < env->me_dxb_mmap.limit)
|
||||
? env->me_dxb_mmap.filesize
|
||||
: env->me_dxb_mmap.limit);
|
||||
#endif /* MDBX_USE_VALGRIND || __SANITIZE_ADDRESS__ */
|
||||
|
||||
//-------------------------------- validate/rollback head & steady meta-pages
|
||||
|
Loading…
x
Reference in New Issue
Block a user