[compiler-rt] [llvm] [msan] Add experimental '-mllvm -msan-embed-faulting-instruction' and MSAN_OPTIONS=print_faulting_instruction (PR #136539)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 16:20:59 PDT 2025


vitalybuka wrote:

> > Why DEBUG_COUNTER DebugInsertCheck and DebugInstrumentInstruction are not enough?
> 
> * Compared to `MSAN_OPTIONS=print_faulting_instruction=...`: DebugInsertCheck and DebugInstrumentInstruction requires trial and error (bisection?) to find the debug counter value that would isolate the failing instruction. Doing the bisection - which requires recompiling and then rerunning the binary - is a lot of manual effort and a waste of compute resources.

But it's generic and well known. And can debug wider range of problems.

> * Compared to the proposed but not implemented `MSAN_OPTIONS=ignore_faulting_instruction=...`: DebugInsertCheck and DebugInstrumentInstruction are configured at compile-time, while ignore_faulting_instruction is compile one-time with instrumentation and then configure at runtime which instructions to skip.

How big is binary size overhead?

https://github.com/llvm/llvm-project/pull/136539


More information about the llvm-commits mailing list