[Bug sanitizer/79944] asan: incorrect instrumentation of atomic operations
dvyukov at google dot com
gcc-bugzilla@gcc.gnu.org
Tue Mar 7 20:11:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79944
--- Comment #4 from Dmitry Vyukov <dvyukov at google dot com> ---
Attached second minimized reproducer.
Build it with:
gcc dmaengine2.c -fsanitize=address -O2 -lasan -g
It produces:
==57662==ERROR: AddressSanitizer: unknown-crash on address 0x000000601321 at pc
0x000000400729 bp 0x7ffdd78835b0 sp 0x7ffdd78835a8
WRITE of size 8 at 0x000000601321 thread T0
#0 0x400728 in clear_bit /tmp/dmaengine2.c:10
#1 0x400728 in dma_channel_table_init /tmp/dmaengine2.c:130
#2 0x400728 in main /tmp/dmaengine2.c:207
On the following line:
__atomic_fetch_and((char *)addr + (nr / 8), (char)(~(1 << (nr % 8))), 0);
This is access of size 1, not 8.
More information about the Gcc-bugs
mailing list