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

            Bug ID: 115837
           Summary: ASAN FPE on unknown address report missing
           Product: gcc
           Version: 11.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bic60176 at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Created attachment 58617
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58617&action=edit
testcase

OS: Ubuntu 22.04.3 LTS
We found a case that ASAN did not report FPE errors when compiling with
gcc-10.5.0, gcc-11.4.0, and gcc-12.3.0.

$ ../compiler-builds/gcc-12.3.0_build/bin/gcc -fsanitize=undefined
-fsanitize=address -g -lgcc_s -I/home/csmith/include/csmith-2.3.0 -O0
testcase.c -o exec

$ timeout 1s ./exec 2>exec.err
11
$ cat exec.err
testcase.c:11:33: runtime error: shift exponent 7074 is too large for 32-bit
type 'int'
tesstcase.c:11:39: runtime error: division by zero

$ ../compiler-builds/gcc-13.2.0_build/bin/gcc -fsanitize=undefined
-fsanitize=address -g -lgcc_s -I/home/csmith/include/csmith-2.3.0 -O0
testcase.c -o exec

$ timeout 1s ./exec 2>exec.err

$ cat exec.err
testcase.c:11:33: runtime error: shift exponent 7074 is too large for 32-bit
type 'int'
testcase.c:11:39: runtime error: division by zero AddressSanitizer:DEADLYSIGNAL
=================================================================
==1810903==ERROR: AddressSanitizer: FPE on unknown address 0x00000040120a (pc
0x00000040120a bp 0x7fff61b599d0 sp 0x7fff61b599a0 T0) #0 0x40120a in u
analysis/test400012_3-m.c:11 #1 0x401241 in main testcase.c:14 #2
0x7e1d51429d8f in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58 #3 0x7e1d51429e3f in
__libc_start_main_impl ../csu/libc-start.c:392 #4 0x4010c4 in _start
(./exec6+0x4010c4) AddressSanitizer can not provide additional info. SUMMARY:
AddressSanitizer: FPE testcase.c:11 in u ==1810903==ABORTING

Reply via email to