[Bug sanitizer/82501] AddressSanitizer does not handle negative offset for first global variable
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 22 09:07:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501
--- Comment #15 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Franz Sirl from comment #3)
> Created attachment 43650 [details]
> another testcase
>
> On x86_64-linux, when compiled with "gcc-7 -O2 -fsanitize=address" this
> testcase prints nothing. With "gcc-7 -O2 -fsanitize=address
> -fsanitize=undefined" this slightly confusing message is output:
>
> test-asan1.c:36:29: runtime error: load of address 0x000000602660 with
> insufficient space for an object of type 'inttype'
> 0x000000602660: note: pointer points here
> 0c 00 00 00 80 20 60 00 00 00 00 00 28 00 00 00 00 00 00 00 60 00 00 00
> 00 00 00 00 80 0c 40 00
> ^
> test-asan1.c:36:29: runtime error: store to address 0x000000602660 with
> insufficient space for an object of type 'inttype'
> 0x000000602660: note: pointer points here
> 0c 00 00 00 80 20 60 00 00 00 00 00 28 00 00 00 00 00 00 00 60 00 00 00
> 00 00 00 00 80 0c 40 00
> ^
This is a different story and properly caught by UBSAN.
More information about the Gcc-bugs
mailing list