alexcrichton requested pchickey for a review on PR #10024.
alexcrichton requested wasmtime-core-reviewers for a review on PR #10024.
alexcrichton opened PR #10024 from alexcrichton:fix-fuzz-issue
to bytecodealliance:main
:
This commit is an attempt to fix a number of flaky crashes that we've been seeing on OSS-Fuzz for some time now. These crashes only reproduce under ASAN and even then have been spotty to reproduce. The current thinking is that a test with threads (e.g. only
wast_tests
using some of the threads spec tests) is required to run some wasm which will register asigaltstack
. Destruction of thissigaltstack
happens with TLS destructors which seems to have a bad interaction with ASAN state additionally being destroyed around that time.This whole interaction means that no one test case is enough to reproduce the corruption. Many crashes on OSS-Fuzz are likely due to "some historical test case spawned a thread" which corrupted something to crash later. The test case that I can reproduce with locally requires rerunning it in the same process a few thousand times to get a reproduction.
The purpose of the
sigaltstack
is to ensure that we have a big enough stack, primarily in debug mode, for testing if a trap is wasm. The hope is that this extra size of the Rust-standard-library-default's stack size is not necessary in release mode with ASAN. In the end time will tell with OSS-Fuzz to see if we can keep this or if we need to both install a bigger sigaltstack in addition to managing them differently in ASAN builds.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
cfallin submitted PR review:
LGTM -- Alex, Nick and I talked about this offline for a bit today. Thanks a bunch for root-causing this -- was very mysterious!
alexcrichton merged PR #10024.
Last updated: Feb 28 2025 at 02:27 UTC