The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
29.11k
stars
12.01k
forks
source link
AddressSanitizer: use-after-poison when calling std::memmove() in moveOperands() #61937
Open
mattpulver opened 1 year ago
Using LLVM 14.0.6 we are experiencing a consistent AddressSanitizer: use-after-poison error w/ stack trace:
It has been difficult to reduce this to a simple self-contained example, but our question is:
When
std::memmove()
was added in https://github.com/llvm/llvm-project/commit/5c0e64fcd6d93ed1033165ed74b524831fff285e was the fact that some of the memory may contain llvm-poisoned addresses taken into consideration? (Or possibly the poisoning of such memory afterstd::memmove()
was added?)That is, https://github.com/llvm/llvm-project/blob/f56b5921d3954cbd99175d0df44030e7782bc456/llvm/lib/CodeGen/MachineInstr.cpp#L187 contains 2 calls to https://github.com/llvm/llvm-project/blob/f56b5921d3954cbd99175d0df44030e7782bc456/llvm/lib/CodeGen/MachineInstr.cpp#L174 which in turn calls
std::memmove()
which is touching the poisoned memory, but not necessarily using those value, but is sufficient to trigger theuse-after-poison
ASan error.OS: CentOS 7 Compiler: GCC 11.1.0