https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104687
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2022-02-25 CC| |marxin at gcc dot gnu.org Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- You are correct of course: gcc pr104687.c pr104687-2.c -fsanitize=address -g && ./a.out ================================================================= ==3100==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000404100 at pc 0x0000004011e9 bp 0x7fffffffde10 sp 0x7fffffffde08 READ of size 8 at 0x000000404100 thread T0 #0 0x4011e8 in main /home/marxin/Programming/testcases/pr104687-2.c:8 #1 0x7ffff73ca62f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #2 0x7ffff73ca6ef in __libc_start_main_impl ../csu/libc-start.c:392 #3 0x4010a4 in _start (/home/marxin/Programming/testcases/a.out+0x4010a4) 0x000000404100 is located 0 bytes to the right of global variable 'table' defined in 'pr104687.c:4:17' (0x404100) of size 0 'table' is ascii string '' SUMMARY: AddressSanitizer: global-buffer-overflow /home/marxin/Programming/testcases/pr104687-2.c:8 in main Shadow bytes around the buggy address: 0x0000800787d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800787e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800787f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078810: f9 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 =>0x000080078820:[f9]f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080078870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Let me fix that.