This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How does address sanitizer handle read-modify-write memory access?
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Fri, 14 Dec 2012 10:22:27 +0100
- Subject: How does address sanitizer handle read-modify-write memory access?
Hello!
c-c++-common/asan/null-deref-1.c test can generate read-modify-write
instruction ("incl 40(%eax)") when compiled with -Os. However,
address-sanitizer only calls __asan_report_load4 in this case. With
-O2, load of value, modification and store are different instructions,
and address-sanitizer calls __asan_report_load4 and
__asan_report_store4.
BTW: This testcase currently fails on x32 [1], but I don't have x32
runtime to investigate runtime failure further.
[1] http://gcc.gnu.org/ml/gcc-testresults/2012-12/msg01227.html
Uros.