[compiler-rt] Add opt-in -ftrivial-auto-var-init flag for writing over uninitialized...
authorLeonard Chan <leonardchan@google.com>
Thu, 8 Dec 2022 19:29:28 +0000 (19:29 +0000)
committerLeonard Chan <leonardchan@google.com>
Thu, 8 Dec 2022 19:30:13 +0000 (19:30 +0000)
commitf9b80ed7fb83fa585065cccadc8f033a9d566e74
treea9f38eb188fbabdaa37bdc3f1269a7c964880189
parent32cc7d3497507c6e6a150d7cbd58308f9a1558b4
[compiler-rt] Add opt-in -ftrivial-auto-var-init flag for writing over uninitialized stack variiables

This might allow lsan to find more leaks that would have gone
undetected. When lsan searches for leaked pointers on the stack, if a
leaked pointer that was pushed to the stack in a prior function call
would not be scrubbed on a future function call, then the scan will see
the pointer on the stack and not mark it as leaked. Such holes can exist
in the lsan runtime where there may be uninitialized data. Adding
auto-var-init can scrub some of that data and might be able to catch
more leaks that would've gone undetected this way.

See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=111351 for more
details.

Differential Revision: https://reviews.llvm.org/D135716
compiler-rt/CMakeLists.txt
compiler-rt/cmake/config-ix.cmake