Skip to content

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

Closed
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:msan_stat
Closed

vstinner wants to merge 1 commit into
python:mainfrom
vstinner:msan_stat

Conversation

@vstinner

@vstinner vstinner commented Mar 1, 2022 •

Copy link
Copy Markdown
Member

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().
Comment thread Modules/posixmodule.c
STRUCT_STAT st;
int result;

# if __has_feature(memory_sanitizer)

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

5 participants