public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112812] New: Regression: ASAN + stack-protector breaks alignment of stack variables
@ 2023-12-01 17:19 tonyb at cybernetics dot com
  2023-12-01 17:42 ` [Bug target/112812] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: tonyb at cybernetics dot com @ 2023-12-01 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112812
           Summary: Regression: ASAN + stack-protector breaks alignment of
                    stack variables
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tonyb at cybernetics dot com
  Target Milestone: ---

Created attachment 56755
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56755&action=edit
Test case

The combination of -fsanitize=address and -fstack-protector-strong causes gcc
13 to misalign stack variables.  Attached is a test program that requests
64-byte alignment of a stack variable.  With -fsanitize=address and
-fstack-protector-strong, the address is aligned on a 32-byte boundary but not
a 64-byte boundary.  With other combinations of options the alignment is
correct.  Running on x86_64.

Compile options:
gcc -m64 -Wall -O2 -U_FORTIFY_SOURCE -fstack-protector-strong
-fsanitize=address -fno-omit-frame-pointer

Test fails with gcc version 13.2.1 20231201
Configured with: ../gcc/configure --host=x86_64-pc-linux-gnu
--enable-languages=c

I believe gcc 12 did not have this bug.  I noticed the problem when UBSan
complained about a misaligned pointer which led back to a stack variable after
upgrading from gcc 12.3 to gcc 13.2.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug target/112812] Regression: ASAN + stack-protector breaks alignment of stack variables
  2023-12-01 17:19 [Bug c/112812] New: Regression: ASAN + stack-protector breaks alignment of stack variables tonyb at cybernetics dot com
@ 2023-12-01 17:42 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-01 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 110027 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-01 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01 17:19 [Bug c/112812] New: Regression: ASAN + stack-protector breaks alignment of stack variables tonyb at cybernetics dot com
2023-12-01 17:42 ` [Bug target/112812] " pinskia 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).