public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109882] New: -fsanitize=thread #include <memory> transitively includes sanitizer/common_interface_defs.h
@ 2023-05-16 23:14 ed at catmur dot uk
  2023-05-16 23:26 ` [Bug libstdc++/109882] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: ed at catmur dot uk @ 2023-05-16 23:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109882
           Summary: -fsanitize=thread #include <memory> transitively
                    includes sanitizer/common_interface_defs.h
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

Since 12.3.0, when compiled under tsan (-fsanitize=thread), #include <memory>
transitively includes sanitizer/common_interface_defs.h:

#include <memory>
#if defined SANITIZER_COMMON_INTERFACE_DEFS_H
#error :(
#endif

This is problematic for us because sanitizer/common_interface_defs.h has
#define __has_feature(x) 0
https://github.com/gcc-mirror/gcc/blame/5d85b5d649fff675ff00adcc99371bccf4ef5944/libsanitizer/include/sanitizer/common_interface_defs.h#L20

which makes our sanitizer detector incorrectly believe that __has_feature is
available and that tsan is not in fact present since
__has_feature(thread_sanitizer) evaluates to 0.

We will fix the order of checks to put `#ifdef __SANITIZE_THREAD__` first but
thought we should probably report this to help other users.

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

end of thread, other threads:[~2023-11-27 11:08 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16 23:14 [Bug libstdc++/109882] New: -fsanitize=thread #include <memory> transitively includes sanitizer/common_interface_defs.h ed at catmur dot uk
2023-05-16 23:26 ` [Bug libstdc++/109882] " pinskia at gcc dot gnu.org
2023-05-16 23:27 ` [Bug sanitizer/109882] " pinskia at gcc dot gnu.org
2023-05-16 23:28 ` pinskia at gcc dot gnu.org
2023-05-16 23:45 ` redi at gcc dot gnu.org
2023-05-17  8:19 ` [Bug sanitizer/109882] sanitizer/common_interface_defs.h bogusly defines __has_feature redi at gcc dot gnu.org
2023-05-17  8:28 ` jakub at gcc dot gnu.org
2023-05-17 11:34 ` redi at gcc dot gnu.org
2023-05-18 12:50 ` redi at gcc dot gnu.org
2023-09-18 22:34 ` redi at gcc dot gnu.org
2023-11-09 10:05 ` redi at gcc dot gnu.org
2023-11-09 10:12 ` sjames at gcc dot gnu.org
2023-11-15 11:57 ` sjames at gcc dot gnu.org
2023-11-15 12:36 ` redi at gcc dot gnu.org
2023-11-15 12:37 ` redi at gcc dot gnu.org
2023-11-15 12:40 ` jakub at gcc dot gnu.org
2023-11-15 12:47 ` sjames at gcc dot gnu.org
2023-11-27 11:08 ` acoplan 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).