Skip to content

bpo-46887: Work around clang MSAN bug on stat()/fstat() #31633

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

Closed
wants to merge 1 commit into from
Closed

bpo-46887: Work around clang MSAN bug on stat()/fstat() #31633

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 1, 2022

Initialize the input "struct stat" buffer with zeros to prevent a
false alarm on calling stat() and fstat().

https://bugs.python.org/issue46887

Initialize the input "struct stat" buffer with zeros to prevent a
false alarm on calling stat() and fstat().
@@ -2484,6 +2484,12 @@ posix_do_stat(PyObject *module, const char *function_name, path_t *path,
STRUCT_STAT st;
int result;

# if __has_feature(memory_sanitizer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It requires a check if __has_feature is defined

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyport.h defines _Py_MEMORY_SANITIZER for us, taking care of all of the compiler/platform conditionals around this.

@vstinner
Copy link
Member Author

I don't want to merge this PR, I would prefer to wait until llvm/llvm-project#54131 is fixed. Problem: LLVM told me that LLVM is fined, it's a Fedora issue. Ah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants