From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5693A3858C39; Fri, 17 Feb 2023 13:32:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5693A3858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676640756; bh=hSOt3glMBJI/KaPwT7qVbQQ2+FTv+UrJFBHXiiToR9E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SOu5bZfBl8fy0lMRBgShbqKA8HKIPpui/q0k9brtOidnrMz7secPgBsxbCxU0WTND x7N3CCwjvnMHbJT9I33PBioNKfRVj5VQsc0RAPiwvefArxrmqtbc2+1fs4dVeA2EUZ ME7pVul90ikqe3qss5txXxAq91v5Wdc2j4TA9b2Y= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/108834] LTO: ltrans temporary file is used as module name in ASAN Date: Fri, 17 Feb 2023 13:32:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108834 --- Comment #2 from Martin Li=C5=A1ka --- So the module name is a string that is displayed when an ASAN error happens= and I see a discrepancy in between GCC and Clang (with LTO): $ cat jhead.i int x; int *p; int main() { p =3D &x; *(p + 1) =3D 123; return 0; } $ clang jhead.i -fsanitize=3Daddress -flto && ./a.out ... 0x555555fc34e4 is located 28 bytes to the left of the global variable 'p' defined in 'jhead.i' (0x555555fc3500) of size 8 $ gcc jhead.i -fsanitize=3Daddress -flto && ./a.out ... 0x000000404104 is located 60 bytes before global variable 'p' defined in '/tmp/cci9oq4s.ltrans0.o' (0x404140) of size 8 $ gcc jhead.i -fsanitize=3Daddress && ./a.out ... 0x000000404104 is located 0 bytes after global variable 'x' defined in 'jhead.i' (0x404100) of size 4 So, yes, we should follow the DECL_CONTEXT.=