-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-35214: Initial clang MemorySanitizer support #10479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This makes it easier to enable clang's memory and undefined behavior sanitizers on a build without manually setting CFLAGS and LDFLAGS. This also encodes the detail that address sanitizer and memory sanitizer should disable pymalloc.
This allows code to easily take conditional action when in an msan build. Usually used for telling msan things it can't otherwise figure out such as syscall, asm behavior, or about libc functions it isn't yet aware of.
These teach MSan about syscalls, asm behavior, or otherwise address clang memory sanitizer flagged issues.
A news entry will come. I put the PR up to see what the CI thinks of this on various platforms. I run the current undefined behavior sanitizer buildbot and am setting up a memory sanitizer buildbot. This is a prerequisite for that to be useful. |
Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
Sorry, @gpshead, I could not cleanly backport this to |
Sorry, @gpshead, I could not cleanly backport this to |
Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this. (cherry picked from commit 1584a00)
Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this.. (cherry picked from commit 1584a00) Co-authored-by: Gregory P. Smith <[email protected]>
GH-10492 is a backport of this pull request to the 3.7 branch. |
…-10492) Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this. (cherry picked from commit 1584a00) Co-authored-by: Gregory P. Smith <[email protected]> [Google LLC]
Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this. (cherry picked from commit 1584a00) Contributed by Gregory P. Smith [Google LLC]
Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this.. (cherry picked from commit 1584a00) Co-authored-by: Gregory P. Smith <[email protected]>
GH-10493 is a backport of this pull request to the 3.6 branch. |
…-10493) Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this. (cherry picked from commit 1584a00) Contributed by Gregory P. Smith [Google LLC] Also includes a whitespace fix from make patchcheck to _posixsubprocess.c - unrelated to the main change that makes the CI happy so I'm just doing it now rather than creating a separate PR.
Adds a convenient configure flags for --with-memory-sanitizer and --with-undefined-behavior-sanitizer.
Fixes up the CPython code base to be mostly memory sanitizer clean. These changes come from patches we've been using at Google.
https://bugs.python.org/issue35214