runtimeverification / runtimeverification/wasm-semantics
Valstack Bug
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 106
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
I have a test case:
(module
(func (export "unmatch") (result i32) (i64.const 700))
)
(invoke "unmatch")
#assertTopStackExactly < i32 > 123 "dummy test 1"
#assertTopStack < i32 > 456 "dummy test 1"
#clearConfig
The return type of function "unmatch" is not matched with the top of stack, so instead of returning a value, it will keep a #take ( i32 .ValTypes , < i64 > 700 : .ValStack ) ++ .ValStack on the <valstack>.
The interesting thing is that when using Java backend if the <valstack> is at the state above, any stack assertion will pass no matter what value you assert, therefore all assertions becomes useless.
Also, the output of the program above with Ocaml backend is also abnormal. All it outputs is:
#take ( i32 .ValTypes , < i64 > 700 : .ValStack )
, but I think it should output the whole configuration.
Contributor guide
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
Start with the test case in the issue and trace the Java backend's stack assertion behavior when the valstack contains the shown #take state. Compare that result with the OCaml backend output; done means invalid assertions do not all pass and the OCaml backend prints the complete configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100