https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63369
Bug ID: 63369
Summary: many asan test cases fail on ARM
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: bernd.edlinger at hotmail dot de
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
with the trunk revision 215254 from 09/14 2014
I see the following asan test casese fail on armv7l-unknown-linux-gnueabihf
FAIL: c-c++-common/asan/global-overflow-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/global-overflow-1.c -O3 -fomit-frame-pointer output
pattern test, is
=================================================================
FAIL: c-c++-common/asan/global-overflow-1.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/global-overflow-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/global-overflow-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O0 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O3 -fomit-frame-pointer output
pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -O0 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -O3 -fomit-frame-pointer output pattern
test, is =================================================================
FAIL: c-c++-common/asan/misalign-1.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -O0 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -O3 -fomit-frame-pointer output pattern
test, is =================================================================
FAIL: c-c++-common/asan/misalign-2.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/misalign-2.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/null-deref-1.c -O0 output pattern test, is
ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -O1 output pattern test, is
ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -O2 output pattern test, is
ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -O3 -fomit-frame-pointer output
pattern test, is ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -O3 -g output pattern test, is
ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -Os output pattern test, is
ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is ASAN:SIGSEGV
FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is ASAN:SIGSEGV
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O0 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O3 -fomit-frame-pointer
output pattern test, is
=================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O3 -g output pattern test,
is =================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 -flto
-fno-use-linker-plugin -flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/stack-overflow-1.c -O3 -fomit-frame-pointer output
pattern test, is
=================================================================
FAIL: c-c++-common/asan/stack-overflow-1.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/stack-overflow-1.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strlen-overflow-1.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O0 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O3 -fomit-frame-pointer output
pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O0 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O1 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O2 output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O3 -fomit-frame-pointer output
pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O3 -g output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -Os output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: c-c++-common/asan/use-after-free-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O0 output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O1 output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O2 output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O3 -fomit-frame-pointer output pattern
test, is =================================================================
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O3 -g output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-stack-uaf-1.C -Os output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-tail-call-1.C -O2 output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-tail-call-1.C -O3 -fomit-frame-pointer output pattern
test, is =================================================================
FAIL: g++.dg/asan/deep-tail-call-1.C -O3 -g output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-tail-call-1.C -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: g++.dg/asan/deep-tail-call-1.C -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O0 output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O1 output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O2 output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O3 -fomit-frame-pointer output
pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O3 -g output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -Os output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O2 -flto -fno-use-linker-plugin
-flto-partition=none output pattern test, is
=================================================================
FAIL: g++.dg/asan/large-func-test-1.C -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects output pattern test, is
=================================================================
I most of the time, the line numbers are just off by 1:
example:
FAIL: c-c++-common/asan/global-overflow-1.c -O2 output pattern test, is
=================================================================
==7129==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00010caa
at pc 0x87dc bp 0x7ec0a664 sp 0x7ec0a65c
READ of size 1 at 0x00010caa thread T0
#0 0x87dc in main
/home/ed/gnu/gcc-5-20140914/gcc/testsuite/c-c++-common/asan/global-overflow-1.c:21
#1 0x76862fda in __libc_start_main (/lib/libc.so.6+0x16fda)
0x00010caa is located 0 bytes to the right of global variable 'YYY' from
'/home/ed/gnu/gcc-5-20140914/gcc/testsuite/c-c++-common/asan/global-overflow-1.c'
(0x10ca0) of size 10
0x00010caa is located 54 bytes to the left of global variable 'ZZZ' from
'/home/ed/gnu/gcc-5-20140914/gcc/testsuite/c-c++-common/asan/global-overflow-1.c'
(0x10ce0) of size 10
SUMMARY: AddressSanitizer: global-buffer-overflow
/home/ed/gnu/gcc-5-20140914/gcc/testsuite/c-c++-common/asan/global-overflow-1.c:21
main
Shadow bytes around the buggy address:
0x20002140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x20002150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x20002160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x20002170: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
0x20002180: 00 00 00 00 00 00 00 00 00 00 00 00 00 02 f9 f9
=>0x20002190: f9 f9 f9 f9 00[02]f9 f9 f9 f9 f9 f9 00 02 f9 f9
0x200021a0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
0x200021b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x200021c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x200021d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x200021e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
ASan internal: fe
==7129==ABORTING
, should match READ of size 1 at 0x[0-9a-f]+ thread T0.*(
|
|
) #0 0x[0-9a-f]+ (in _*main ([^
]*global-overflow-1.c:20|[^
]*:0)|[(])[^
]*(
|
|
).*0x[0-9a-f]+ is located 0 bytes to the right of global variable.*YYY[^
]* of size 10[^
]*(
|
|
)
=> line 21 reported vs 20 expected.
I am not sure if this is related to PR61771 which has to do
with incomplete malloc call stacks or something different.