Stream: git-wasmtime

Topic: wasmtime / issue #2582 Run Cranelift tests under Valgrind...


view this post on Zulip Wasmtime GitHub notifications bot (May 04 2022 at 22:47):

cfallin labeled issue #2582:

We should consider adding a CI job that runs at least the Cranelift Wasm spec tests using Valgrind. This would allow us to more easily and deterministically catch subtle issues with generated code.

As an example, in #2432, we found that we were JIT'ing a sequence of instructions that depended in a subtle way on initial (undefined) register state. Specifically, we used an SSE compare instruction, comparing a temp reg against itself to produce all-ones, because x == x always... except when x is NaN, hence nondeterministic failures. Valgrind correctly models the semantics of the compare instruction that we used, and detected that our generated code depended on the initial (undefined) value of an XMM register.

We would likely benefit at least from the undefined-state tracking, as in above. ABI and VM interface-adjacent work (which tend to be pointer-heavy) may benefit from memcheck as well.


Last updated: Dec 23 2024 at 12:05 UTC