From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 058C7385840D; Wed, 24 Apr 2024 15:07:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 058C7385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713971235; bh=MyYF8l4i2womiwedb3vczexEWKc8sbYQc3Gd58NeR1k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AeO/w1kBPfN+RgrNlXOuPk1oilMlPRwUmg67Zes2vbi5BZM9sANtnsm2EXrtBExTn Q1nUIjQjt/d2pxEAKN6f1SB7glNN+2KWWv/3yJRJr3gkt250sd45j2YCkjc08+gwPf va8hmh//nkLEXEX5HXbrJo1oJCTD2o/UYoBXipBk= From: "neil.n.carlson at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114827] Valgrind reports errors with class(*) assignment Date: Wed, 24 Apr 2024 15:07:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: neil.n.carlson at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114827 --- Comment #4 from Neil Carlson --- Same results with 13.2.0 configured with --enable-valgrind-annotations. Here's the output with 13.2.0 and gfortran -g -O0 -fsanitize=3Daddress foo.= f90 : =3D=3D1126830=3D=3DERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000071 at pc 0x7fb97cc6b21d bp 0x7ffcd7a79200 sp 0x7ffcd7a789c0 WRITE of size 27 at 0x602000000071 thread T0 #0 0x7fb97cc6b21c in __interceptor_memmove ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc= :882 #1 0x4012ca in __copy_character_1 /home/nnc/Codes/petaca/bugs/foo.f90:1 #2 0x401a14 in foo /home/nnc/Codes/petaca/bugs/foo.f90:11 #3 0x401cf9 in run /home/nnc/Codes/petaca/bugs/foo.f90:6 #4 0x401374 in MAIN__ /home/nnc/Codes/petaca/bugs/foo.f90:2 #5 0x401fc6 in main /home/nnc/Codes/petaca/bugs/foo.f90:2 #6 0x7fb97c646149 in __libc_start_call_main (/lib64/libc.so.6+0x28149) (BuildId: e0b579ca7024cf12a2686b60cf49d1d9e3ff6273) #7 0x7fb97c64620a in __libc_start_main_impl (/lib64/libc.so.6+0x2820a) (BuildId: e0b579ca7024cf12a2686b60cf49d1d9e3ff6273) #8 0x401194 in _start (/home/nnc/Codes/petaca/bugs/a.out+0x401194) 0x602000000071 is located 0 bytes after 1-byte region [0x602000000070,0x602000000071) allocated by thread T0 here: #0 0x7fb97ccdc2ef in __interceptor_malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x4017c9 in foo /home/nnc/Codes/petaca/bugs/foo.f90:11 #2 0x401cf9 in run /home/nnc/Codes/petaca/bugs/foo.f90:6 #3 0x401374 in MAIN__ /home/nnc/Codes/petaca/bugs/foo.f90:2 #4 0x401fc6 in main /home/nnc/Codes/petaca/bugs/foo.f90:2 #5 0x7fb97c646149 in __libc_start_call_main (/lib64/libc.so.6+0x28149) (BuildId: e0b579ca7024cf12a2686b60cf49d1d9e3ff6273) #6 0x7fb97c64620a in __libc_start_main_impl (/lib64/libc.so.6+0x2820a) (BuildId: e0b579ca7024cf12a2686b60cf49d1d9e3ff6273) #7 0x401194 in _start (/home/nnc/Codes/petaca/bugs/a.out+0x401194) SUMMARY: AddressSanitizer: heap-buffer-overflow ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc= :882 in __interceptor_memmove Shadow bytes around the buggy address: 0x601ffffffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x601ffffffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x601ffffffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x601fffffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x601fffffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =3D>0x602000000000: fa fa 06 fa fa fa 07 fa fa fa 07 fa fa fa[01]fa 0x602000000080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000000100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000000180: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000000200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000000280: 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=20 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 =3D=3D1126830=3D=3DABORTING=