WebAssembly / WebAssembly/wasi-sdk
SDK should support Undefined Behavior Sanitizer
Nobody has claimed this yet.
- Dominant language
- CMake
- Stars
- 1.6k
- Forks
- 237
- Avg merge
- 18h 26m
- Merged PRs (30d)
- 5
Description
Per https://github.com/llvm/llvm-project/issues/151015#issuecomment-3130203774.
Currently it results in a linker error:
$ /opt/wasi-sdk/bin/clang -fsanitize=undefined test.c
wasm-ld: error: /tmp/test-1cf416.o: undefined symbol: __ubsan_handle_pointer_overflow
wasm-ld: error: /tmp/test-1cf416.o: undefined symbol: __ubsan_handle_type_mismatch_v1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is because sanitizer runtimes are turned off:
I tried turning them on and that causes a cascade of failures, not the least a bunch of fuzzer headers appearing in include-all.c; some of which don't compile and some introduce new symbols. How should I proceed? I could add them to the find command with exclusions but there's like 15 new headers.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect cmake/wasi-sdk-sysroot.cmake around the sanitizer-runtime setting and review how enabling it affects include-all.c. Reproduce the issue with the shown clang -fsanitize=undefined command, then verify that the SDK links successfully without the reported UBSan symbols or header-related failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, wasm
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100