public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/115972] New: [10/11 Regression] Misaligned address error check missing
@ 2024-07-17 19:49 bic60176 at gmail dot com
2024-07-18 2:46 ` [Bug sanitizer/115972] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: bic60176 at gmail dot com @ 2024-07-17 19:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115972
Bug ID: 115972
Summary: [10/11 Regression] Misaligned address error check
missing
Product: gcc
Version: 11.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: bic60176 at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
Target Milestone: ---
Created attachment 58694
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58694&action=edit
testcase
We found that gcc-10.5.0 fails to detect a misaligned address error at the Os
optimization level.
$ ~/compiler-builds/gcc-12.3.0_build/bin/gcc -fsanitize=undefined -g -lgcc_s -w
-Os testcase.c -o exec
$ timeout 2s ./exec 2>exec.err
0
$ cat exec.err
testcase.c:19:6: runtime error: store to misaligned address 0x7fff81dcd443 for
type 'int32_t', which requires 4 byte alignment
0x7fff81dcd443: note: pointer points here
01 00 00 00 02 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00
90 dd eb cb b6 7f 00
^
testcase.c:20:3: runtime error: load of misaligned address 0x7fff81dcd443 for
type 'int32_t', which requires 4 byte alignment
0x7fff81dcd443: note: pointer points here
01 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00
90 dd eb cb b6 7f 00
^
testcase.c:21:20: runtime error: load of misaligned address 0x7fff81dcd443 for
type 'int32_t', which requires 4 byte alignment
0x7fff81dcd443: note: pointer points here
01 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00
90 dd eb cb b6 7f 00
^
$ ~/compiler-builds/gcc-11.4.0_build/bin/gcc -fsanitize=undefined -g -lgcc_s -w
-Os testcase.c -o exec
$ timeout 2s ./exec 2>exec.err
0
$ cat exec.err
$
We also found that gcc-11.4.0 fails to detect a misaligned address error at the
Os optimization level.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-18 6:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17 19:49 [Bug sanitizer/115972] New: [10/11 Regression] Misaligned address error check missing bic60176 at gmail dot com
2024-07-18 2:46 ` [Bug sanitizer/115972] " pinskia at gcc dot gnu.org
2024-07-18 6:26 ` xry111 at gcc dot gnu.org
2024-07-18 6:26 ` xry111 at gcc dot gnu.org
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).