Commit 84c42d1b by Alexis Hetu Committed by Angle LUCI CQ

Mute MSAN false positive

MSAN currently detects false positives on global/static thread_local variables which are created at library load time. This CL mutes the false positive in order to unblock running blink_web_tests with SwANGLE on MSAN bots. Bug: chromium:1211047 Change-Id: I7cd103d470177d783df7f73ca6ceeedc0774b163 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2920486 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent de7f559e
...@@ -310,6 +310,15 @@ inline bool IsLittleEndian() ...@@ -310,6 +310,15 @@ inline bool IsLittleEndian()
# define ANGLE_SCOPED_DISABLE_LSAN() # define ANGLE_SCOPED_DISABLE_LSAN()
#endif #endif
// The ANGLE_NO_SANITIZE_MEMORY macro suppresses MemorySanitizer checks for
// use-of-uninitialized-data. It can be used to decorate functions with known
// false positives.
#ifdef __clang__
# define ANGLE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory))
#else
# define ANGLE_NO_SANITIZE_MEMORY
#endif
// The below inlining code lifted from V8. // The below inlining code lifted from V8.
#if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute)) #if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute))
# define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) # define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
......
...@@ -87,7 +87,8 @@ void SetGlobalLastContext(gl::Context *context) ...@@ -87,7 +87,8 @@ void SetGlobalLastContext(gl::Context *context)
g_LastContext = context; g_LastContext = context;
} }
Thread *GetCurrentThread() // This function causes an MSAN false positive, which is muted. See https://crbug.com/1211047
ANGLE_NO_SANITIZE_MEMORY Thread *GetCurrentThread()
{ {
Thread *current = gCurrentThread; Thread *current = gCurrentThread;
return (current ? current : AllocateCurrentThread()); return (current ? current : AllocateCurrentThread());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment