diff options
author | Sverker Eriksson <[email protected]> | 2013-09-13 17:37:44 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-09-30 17:45:46 +0200 |
commit | 4ba6824a90943e74e8fdd02f3cb695931093bcca (patch) | |
tree | ef9c70c72a5bb606e01599c2408f10bc2c7c540a /erts/emulator | |
parent | b9e82ba0be1364c64e90274d5e9bf37f78b676ee (diff) | |
download | otp-4ba6824a90943e74e8fdd02f3cb695931093bcca.tar.gz otp-4ba6824a90943e74e8fdd02f3cb695931093bcca.tar.bz2 otp-4ba6824a90943e74e8fdd02f3cb695931093bcca.zip |
erts: Fix race bug in erts_munmap
Must keep mutex to serialize (un)reserve ops.
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/sys/common/erl_mmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/sys/common/erl_mmap.c b/erts/emulator/sys/common/erl_mmap.c index 93a95e5eef..317e3ec391 100644 --- a/erts/emulator/sys/common/erl_mmap.c +++ b/erts/emulator/sys/common/erl_mmap.c @@ -1762,12 +1762,12 @@ erts_munmap(Uint32 flags, void *ptr, UWord size) supercarrier_success: { UWord unres_sz; - erts_smp_mtx_unlock(&mmap_state.mtx); - ERTS_MMAP_ASSERT(size >= ad_sz); unres_sz = size - ad_sz; if (unres_sz) mmap_state.unreserve_physical(((char *) ptr) + ad_sz, unres_sz); + + erts_smp_mtx_unlock(&mmap_state.mtx); } } } |