public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53379] [4.8/4.9/5 Regression] No backtrace generated for array bounds violation Date: Tue, 02 Dec 2014 11:59:00 -0000 [thread overview] Message-ID: <bug-53379-4-AEUGAIZYi5@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-53379-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53379 Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2013-12-29 00:00:00 |2014-12-2 CC| |Joost.VandeVondele at mat dot ethz | |.ch --- Comment #15 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> --- still fails with trunk, while this really was a useful feature. > cat test.f90 MODULE m1 CONTAINS SUBROUTINE foo(b) INTEGER, POINTER :: b(:) b(-1)=0 END SUBROUTINE foo END MODULE USE m1 INTEGER, POINTER :: a(:) ALLOCATE(a(0:1)) CALL foo(a) END > gfortran -g -fbacktrace -fbounds-check test.f90 && ./a.out At line 5 of file test.f90 Fortran runtime error: Index '-1' of dimension 1 of array 'b' below lower bound of 0 While if we use -fsanitize=address (at greatly increased cost), we actually get a Christmas tree with losts of colourful lights: > gfortran -g -fsanitize=address test.f90 && ./a.out ================================================================= ==32762==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000ef8c at pc 0x000000400c17 bp 0x7fff7f4bd220 sp 0x7fff7f4bd218 WRITE of size 4 at 0x60200000ef8c thread T0 #0 0x400c16 in __m1_MOD_foo /data/vjoost/gnu/bugs/test.f90:5 #1 0x400d1a in MAIN__ /data/vjoost/gnu/bugs/test.f90:12 #2 0x400da2 in main /data/vjoost/gnu/bugs/test.f90:9 #3 0x3094e1ed5c in __libc_start_main (/lib64/libc.so.6+0x3094e1ed5c) #4 0x400a48 (/data/vjoost/gnu/bugs/a.out+0x400a48) 0x60200000ef8c is located 4 bytes to the left of 8-byte region [0x60200000ef90,0x60200000ef98) allocated by thread T0 here: #0 0x7fb401b2ab1a in __interceptor_malloc ../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:38 #1 0x400cc2 in MAIN__ /data/vjoost/gnu/bugs/test.f90:11 #2 0x400da2 in main /data/vjoost/gnu/bugs/test.f90:9 #3 0x3094e1ed5c in __libc_start_main (/lib64/libc.so.6+0x3094e1ed5c) SUMMARY: AddressSanitizer: heap-buffer-overflow /data/vjoost/gnu/bugs/test.f90:5 __m1_MOD_foo Shadow bytes around the buggy address: 0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff9df0: fa[fa]00 fa fa fa 07 fa fa fa 07 fa fa fa 06 fa 0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9e40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 Array cookie: ac Intra object redzone: bb ASan internal: fe ==32762==ABORTING
next prev parent reply other threads:[~2014-12-02 11:59 UTC|newest] Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-05-16 17:17 [Bug fortran/53379] New: [4.7 " anlauf at gmx dot de 2012-05-16 20:30 ` [Bug fortran/53379] " anlauf at gmx dot de 2012-05-18 7:36 ` [Bug fortran/53379] [4.7/4.8 " jb at gcc dot gnu.org 2012-05-18 7:43 ` burnus at gcc dot gnu.org 2012-05-18 14:46 ` jb at gcc dot gnu.org 2012-05-18 15:04 ` anlauf at gmx dot de 2012-05-29 14:40 ` rguenth at gcc dot gnu.org 2012-05-31 19:41 ` anlauf at gmx dot de 2012-05-31 19:46 ` anlauf at gmx dot de 2012-05-31 19:47 ` anlauf at gmx dot de 2012-06-14 8:49 ` rguenth at gcc dot gnu.org 2012-09-20 10:27 ` jakub at gcc dot gnu.org 2013-02-20 21:21 ` jb at gcc dot gnu.org 2013-04-11 8:00 ` [Bug fortran/53379] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org 2013-12-29 11:55 ` dominiq at lps dot ens.fr 2014-06-12 13:45 ` [Bug fortran/53379] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org 2014-12-02 11:59 ` Joost.VandeVondele at mat dot ethz.ch [this message] 2014-12-04 21:05 ` [Bug fortran/53379] [4.8/4.9/5 " anlauf at gmx dot de 2014-12-05 8:46 ` Joost.VandeVondele at mat dot ethz.ch 2014-12-19 13:28 ` jakub at gcc dot gnu.org 2015-06-23 8:22 ` [Bug fortran/53379] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org 2015-06-26 19:58 ` [Bug fortran/53379] [4.9/5/6 " jakub at gcc dot gnu.org 2015-06-26 20:29 ` jakub at gcc dot gnu.org 2015-08-31 16:55 ` Joost.VandeVondele at mat dot ethz.ch 2015-08-31 21:12 ` fxcoudert at gcc dot gnu.org 2015-09-04 22:04 ` jb at gcc dot gnu.org 2015-09-04 22:17 ` jb at gcc dot gnu.org 2015-09-04 22:20 ` jb at gcc dot gnu.org 2015-09-05 6:55 ` Joost.VandeVondele at mat dot ethz.ch
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-53379-4-AEUGAIZYi5@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).