public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sjames at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/115050] Segfault when compiled with -O0
Date: Sun, 12 May 2024 15:50:41 +0000	[thread overview]
Message-ID: <bug-115050-4-Jd8c0GoDKT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115050-4@http.gcc.gnu.org/bugzilla/>

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
Clang trunk UBSAN says:
```
/app/example.cpp:22:5: runtime error: constructor call on misaligned address
0x7ffe75477cbb for type 'Handler<Testor> *', which requires 8 byte alignment
0x7ffe75477cbb: note: pointer points here
 00  62 52 4a fe c8 7b 00 00  01 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00 
01 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:22:5 
/app/example.cpp:22:5: runtime error: constructor call on misaligned address
0x7ffe75477cbb for type 'VTable', which requires 8 byte alignment
0x7ffe75477cbb: note: pointer points here
 00  62 52 4a fe c8 7b 00 00  01 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00 
01 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:22:5 
/app/example.cpp:8:7: runtime error: constructor call on misaligned address
0x7ffe75477cbb for type 'VTable *', which requires 8 byte alignment
0x7ffe75477cbb: note: pointer points here
 00  62 52 4a fe c8 7b 00 00  01 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00 
01 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:8:7 
/app/example.cpp:24:27: runtime error: constructor call on misaligned address
0x7ffe75477cc3 for type 'Testor', which requires 8 byte alignment
0x7ffe75477cc3: note: pointer points here
 68  5a 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00  01 00 00 00 00 00 00 00 
90 9d 42 fe c8 7b 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:24:27 
/app/example.cpp:11:13: runtime error: member call on misaligned address
0x7ffe75477cbb for type 'VTable *', which requires 8 byte alignment
0x7ffe75477cbb: note: pointer points here
 00  62 52 4a 60 4c 47 5d 68  5a 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00 
01 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:11:13 
/app/example.cpp:39:62: runtime error: member call on misaligned address
0x7ffe75477cbb for type 'VTable', which requires 8 byte alignment
0x7ffe75477cbb: note: pointer points here
 00  62 52 4a 60 4c 47 5d 68  5a 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00 
01 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:39:62 
/app/example.cpp:29:5: runtime error: member call on misaligned address
0x7ffe75477cbb for type 'Handler<Testor> *', which requires 8 byte alignment
0x7ffe75477cbb: note: pointer points here
 00  62 52 4a 60 4c 47 5d 68  5a 00 00 00 00 00 00 00  67 6c 69 62 00 00 00 00 
01 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /app/example.cpp:29:5 
 caught! std::bad_exception
```

GCC's reports nothing though.

  parent reply	other threads:[~2024-05-12 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12 11:40 [Bug c++/115050] New: " lobel.krivic at proton dot me
2024-05-12 11:44 ` [Bug c++/115050] " pinskia at gcc dot gnu.org
2024-05-12 15:50 ` sjames at gcc dot gnu.org [this message]
2024-05-28 21:43 ` pinskia 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-115050-4-Jd8c0GoDKT@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).