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

--- Comment #11 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
If the tests are compiled on darwin with an instrumented gfortran, execution
gives

==82783==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x602000000150 at pc 0x000101b79d39 bp 0x7fff5e0a6300 sp 0x7fff5e0a62f8
READ of size 4 at 0x602000000150 thread T0
    #0 0x101b79d38 in _gfortran_caf_event_query
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x100020d38)
    #1 0x101b59f48 in MAIN__
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x100000f48)

0x602000000151 is located 0 bytes to the right of 1-byte region
[0x602000000150,0x602000000151)
allocated by thread T0 here:
    #0 0x101c47f30 in wrap_calloc (/opt/gcc/gcc7a/lib/libasan.4.dylib+0x62f30)
    #1 0x101b615e3 in _gfortran_caf_register
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x1000085e3)
    #2 0x101b7b47d in _caf_init.1.3510
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10002247d)
    #3 0x1089a1961  (<unknown module>)
    #4 0x10899d1ed  (<unknown module>)
    #5 0x10899c267  (<unknown module>)
    #6 0x10899c2fc  (<unknown module>)
    #7 0x10898e479  (<unknown module>)
    #8 0x1089927df  (<unknown module>)
    #9 0x10898d248  (<unknown module>)
    #10 0x10898d035  (<unknown module>)

SUMMARY: AddressSanitizer: heap-buffer-overflow
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x100020d38) in
_gfortran_caf_event_query
Shadow bytes around the buggy address:
  0x1c03ffffffd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c03ffffffe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c03fffffff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c0400000000: fa fa fd fd fa fa fd fd fa fa 00 07 fa fa 00 06
  0x1c0400000010: fa fa 03 fa fa fa 00 00 fa fa 00 06 fa fa 06 fa
=>0x1c0400000020: fa fa 07 fa fa fa 07 fa fa fa[01]fa fa fa 00 00
  0x1c0400000030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0400000070: 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
  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
==82783==ABORTING

Reply via email to