Skip to content

Conversation

@gpshead
Copy link
Member

@gpshead gpshead commented Nov 13, 2018

clang's MemorySanitizer understand getc() but does not understand
getc_unlocked(). Workaround: Don't use it on msan builds.

https://bugs.python.org/issue35214

clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds.
@alex
Copy link
Member

alex commented Nov 13, 2018

Is there a bug filed with MSAN (compiler-rt) for this?

@gpshead
Copy link
Member Author

gpshead commented Nov 13, 2018

Is there a bug filed with MSAN (compiler-rt) for this?

Looking into that... Someone on our internal clang team said this (in 2015) on an internal bug that was was fixed using this workaround instead because of:

"""This can be fixed in MSan, but it may take time. The whole thing is quite messy: _unlocked IO functions access internals of FILE* in glibc headers, which means that MSan needs to catch all cases when glibc (an uninstrumented library) updates buffer pointers inside FILE and unpoison the new target region.

Disabling HAVE_GETC_UNLOCKED under #ifdef MEMORY_SANITIZER is definitely better than what we have now."""

I'm pointing them here to see if anything about that has changed (I'd assume not) while I wait for a clang compiler-rt bugzilla account to be created for me.

@gpshead gpshead merged commit e6c77d8 into python:master Nov 13, 2018
@miss-islington
Copy link
Contributor

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@gpshead gpshead deleted the msan-vs-getc_unlocked branch November 13, 2018 03:47
@bedevere-bot
Copy link

GH-10500 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2018
clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds. (cherry picked from commit e6c77d8) Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-bot
Copy link

GH-10501 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2018
clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds. (cherry picked from commit e6c77d8) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington added a commit that referenced this pull request Nov 13, 2018
clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds. (cherry picked from commit e6c77d8) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington added a commit that referenced this pull request Nov 13, 2018
clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds. (cherry picked from commit e6c77d8) Co-authored-by: Gregory P. Smith <greg@krypto.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants