wasi-sdk
wasi-sdk copied to clipboard
Sanitizer support?
Hi! Is there a path forward towards supporting the Clang sanitizers on wasm32-unknown-wasi?
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.
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).
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.