public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-108834-4-av9RNpjyQA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108834-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
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 = &x;
  *(p + 1) = 123;

  return 0;
}

$ clang jhead.i -fsanitize=address -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=address -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=address && ./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.

  parent reply	other threads:[~2023-02-17 13:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 11:23 [Bug sanitizer/108834] New: " marxin at gcc dot gnu.org
2023-02-17 11:24 ` [Bug sanitizer/108834] " marxin at gcc dot gnu.org
2023-02-17 11:48 ` rguenth at gcc dot gnu.org
2023-02-17 13:32 ` marxin at gcc dot gnu.org [this message]
2023-02-17 14:39 ` jakub at gcc dot gnu.org
2023-02-17 14:43 ` jakub at gcc dot gnu.org
2023-02-17 14:59 ` marxin at gcc dot gnu.org
2023-02-20 13:59 ` marxin at gcc dot gnu.org
2023-02-20 15:40 ` marxin at gcc dot gnu.org
2023-02-20 15:44 ` jakub at gcc dot gnu.org
2023-02-20 16:03 ` marxin at gcc dot gnu.org
2023-02-20 20:10 ` marxin at gcc dot gnu.org
2023-02-24 15:23 ` cvs-commit at gcc dot gnu.org
2023-02-24 15:24 ` marxin at gcc dot gnu.org
2023-02-27  8:32 ` marxin at gcc dot gnu.org
2023-02-27  8:32 ` cvs-commit at gcc dot gnu.org

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-108834-4-av9RNpjyQA@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: link
Be 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).