◐ Shell
clean mode source ↗

bpo-46887: Work around clang MSAN bug on stat()/fstat() by vstinner · Pull Request #31633 · python/cpython

Conversation

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

kumaraditya303

STRUCT_STAT st;
int result;

# if __has_feature(memory_sanitizer)

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

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

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.

Labels