public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/113151] New: Need for a TBAA / strict aliasing sanitizer (TySan)
@ 2023-12-26 18:47 sjames at gcc dot gnu.org
  2023-12-26 20:20 ` [Bug sanitizer/113151] " xry111 at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-12-26 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113151
           Summary: Need for a TBAA / strict aliasing sanitizer (TySan)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                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,
                    marxin at gcc dot gnu.org, xry111 at gcc dot gnu.org
  Target Milestone: ---

It's well-known that -Wstrict-aliasing in GCC has false negatives and is also
easy to confuse/bypass. Aliasing is a common footgun and it's hard because this
is one of the few things that compilers optimise on which UBsan and friends are
no help for.

Ultimately, that's not really the fault of the warning, the fact is some of
this stuff can only really be done at runtime.

LLVM has had stalled and stop-start attempts at this a bunch of times, although
I noticed earlier today that some new PRs got opened for it. They plan on
calling it Type Sanitizer (TySan) with -fsanitize=type. See linked PRs.

(I feel like we must have a bug for this somewhere but I couldn't find it.)

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

* [Bug sanitizer/113151] Need for a TBAA / strict aliasing sanitizer (TySan)
  2023-12-26 18:47 [Bug sanitizer/113151] New: Need for a TBAA / strict aliasing sanitizer (TySan) sjames at gcc dot gnu.org
@ 2023-12-26 20:20 ` xry111 at gcc dot gnu.org
  2024-01-08 14:08 ` rguenth at gcc dot gnu.org
  2024-01-08 14:21 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-12-26 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement
   Last reconfirmed|                            |2023-12-26
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Confirm as I like this idea very much.  At least it would prevent many invalid
bug reports :).

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

* [Bug sanitizer/113151] Need for a TBAA / strict aliasing sanitizer (TySan)
  2023-12-26 18:47 [Bug sanitizer/113151] New: Need for a TBAA / strict aliasing sanitizer (TySan) sjames at gcc dot gnu.org
  2023-12-26 20:20 ` [Bug sanitizer/113151] " xry111 at gcc dot gnu.org
@ 2024-01-08 14:08 ` rguenth at gcc dot gnu.org
  2024-01-08 14:21 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-08 14:08 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
IIRC Jakub tried to implement something at some point.

Note what's needed is runtime tracking of the effective dynamic type of
objects (memory) and enforcing access rules.  Language frontend rules
are not 1:1 compatible and the middle-end implements something common.

It's going to be difficult when not the whole program including runtime
is instrumented.

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

* [Bug sanitizer/113151] Need for a TBAA / strict aliasing sanitizer (TySan)
  2023-12-26 18:47 [Bug sanitizer/113151] New: Need for a TBAA / strict aliasing sanitizer (TySan) sjames at gcc dot gnu.org
  2023-12-26 20:20 ` [Bug sanitizer/113151] " xry111 at gcc dot gnu.org
  2024-01-08 14:08 ` rguenth at gcc dot gnu.org
@ 2024-01-08 14:21 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I was just contemplating its implementation (and/or hoping somebody else would
handle it), never actually implemented anything.

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

end of thread, other threads:[~2024-01-08 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-26 18:47 [Bug sanitizer/113151] New: Need for a TBAA / strict aliasing sanitizer (TySan) sjames at gcc dot gnu.org
2023-12-26 20:20 ` [Bug sanitizer/113151] " xry111 at gcc dot gnu.org
2024-01-08 14:08 ` rguenth at gcc dot gnu.org
2024-01-08 14:21 ` jakub 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).