wasi-sdk icon indicating copy to clipboard operation
wasi-sdk copied to clipboard

Sanitizer support?

Open lnicola opened this issue 6 years ago • 2 comments

Hi! Is there a path forward towards supporting the Clang sanitizers on wasm32-unknown-wasi?

lnicola avatar Nov 13 '19 10:11 lnicola

It's something we're interested in, but there is not yet a specific path.

In theory, UBSan ought to be pretty straightforward, configuring the build and UBSan to be enabled for wasm32-wasi.

My understanding is that asan, msan, tsan, etc. would take more porting effort, because their normal implementations rely on mmap, but I'd be interested if anyone has ideas of what we could do here.

sunfishcode avatar Nov 14 '19 00:11 sunfishcode

The emscripten ports of the sanitizers to wasm depend on JS for a bunch of things that wasm can't do; those are probably the things that would be a problem for WASI. The main missing things are:

  • Stack trace generation.
  • Program counter generation.
  • Return address generation.
  • mmap().
  • Shadow memory (multiple memories might help here).

kripken avatar Nov 14 '19 01:11 kripken

Sanitizers are still desirable, The first step is to implement them in upstream LLVM, and then we could enable support for them in wasi-sdk. So I'll close this for now, and we can revisit when we have upstream features we can enable.

sunfishcode avatar Aug 08 '23 22:08 sunfishcode