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

--- Comment #41 from anlauf at gcc dot gnu.org ---
I cannot reproduce this with 13- to 15-release.  However, at r16-8687:

% gfc-16 -fsanitize=address -g gcc/testsuite/gfortran.dg/assumed_rank_7.f90
% ./a.out 
=================================================================
==1232946==ERROR: AddressSanitizer: stack-buffer-overflow on address
0x7ba5797f0098 at pc 0x7fa57bf270cc bp 0x7fff790e92f0 sp 0x7fff790e8ab0
READ of size 360 at 0x7ba5797f0098 thread T0
    #0 0x7fa57bf270cb in memcpy
../../../../gcc-trunk/libsanitizer/sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:117
    #1 0x0000004019e3 in MAIN__ gcc/testsuite/gfortran.dg/assumed_rank_7.f90:22
    #2 0x000000404555 in main gcc/testsuite/gfortran.dg/assumed_rank_7.f90:25
    #3 0x7fa57b83033f in __libc_start_call_main (/lib64/libc.so.6+0x2a33f)
(BuildId: 09f0d581f82df95136a7f988671000cd633b639d)
    #4 0x7fa57b830408 in __libc_start_main_alias_1 (/lib64/libc.so.6+0x2a408)
(BuildId: 09f0d581f82df95136a7f988671000cd633b639d)
    #5 0x000000401204 in _start ../sysdeps/x86_64/start.S:115

Address 0x7ba5797f0098 is located in stack of thread T0 at offset 152 in frame
    #0 0x000000401375 in MAIN__ gcc/testsuite/gfortran.dg/assumed_rank_7.f90:8

  This frame has 6 object(s):
    [32, 48) 'FRAME.46' (line 8)
    [64, 152) 'at' (line 14)
    [192, 280) 'atmp.22' (line 23) <== Memory access at offset 152 partially
underflows this variable
    [320, 408) 'parm.27' (line 24) <== Memory access at offset 152 partially
underflows this variable
    [448, 856) 'class.19' (line 21) <== Memory access at offset 152 partially
underflows this variable
    [928, 1336) 'class.20' (line 22)
HINT: this may be a false positive if your program uses some custom stack
unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow
gcc/testsuite/gfortran.dg/assumed_rank_7.f90:22 in MAIN__
Shadow bytes around the buggy address:
  0x7ba5797efe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7ba5797efe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7ba5797eff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7ba5797eff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7ba5797f0000: f1 f1 f1 f1 00 00 f2 f2 00 00 00 00 00 00 00 00
=>0x7ba5797f0080: 00 00 00[f2]f2 f2 f2 f2 00 00 00 00 00 00 00 00
  0x7ba5797f0100: 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00
  0x7ba5797f0180: 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00
  0x7ba5797f0200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7ba5797f0280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7ba5797f0300: 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 f2
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
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  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
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==1232946==ABORTING

OTOH, valgrind seems clean.  Maybe a sanitizer-only issue.

Reply via email to