[Bug sanitizer/63564] -fsanitize=address obscures access to free memory

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 16 17:10:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63564

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You would need glibc compiled with -fsanitize=address (unless the write is done
in assembly) to detect that.
And, the reason that glibc malloc reports the problem is that it performs some
cheap checks, in particular if you happen to overwrite glibc malloc's internal
data structures, it will sometimes be able to cheaply detect that and report.
asan malloc doesn't have anything like that.
Expecting that -fsanitize=address will reveal all issues in your code is
unrealistic.



More information about the Gcc-bugs mailing list