Add mmap/munmap interceptors.
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Wed, 5 Oct 2016 14:04:08 +0000 (17:04 +0300)
committerSlava Barinov <v.barinov@samsung.com>
Wed, 13 Sep 2023 11:13:17 +0000 (14:13 +0300)
commitc426e1fe62507f5233cc91bfe45e464051453304
tree86326ffa04ee84ffeedcdd29686d39fc2d3a6c88
parent349941d34fdab9319b8abf937557cc317f506c60
Add mmap/munmap interceptors.

Some allocators may use mmap for their local pools that may cause false positive
reports because LSan currently doesn't intercept mmap call mainly due to its
complexity (we don't know whether a particular mmap would contain live pointers).
However for some cases (e.g. anonymous rw mmaps) we can guess that they would
contain live pointers thus we can add them into root regions. Thus, now we
intercept mmap/munmap calls, add anonymous rw mappings into root regions and
call real mmap.

Change-Id: Ie0bde91497a31ab670f15d67b34d328969dc0981
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
libsanitizer/lsan/lsan.cpp
libsanitizer/lsan/lsan.h
libsanitizer/lsan/lsan_common.cpp
libsanitizer/lsan/lsan_interceptors.cpp