wasm-opt [parse exception: popping from empty stack (at 0:543)]

Open
#8,896 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
wasm
Domain
compilers

Research direction

Start by running wasm-opt --debug on the attached conftest input and trace the parse failure through the path reported at wasm-traversal.h:286. Confirm the mismatch suspected in the issue, then verify that the example no longer crashes or aborts and add a regression test for the input if the existing test structure supports it.

Written by the indexing model from the issue text.

Description

Running some configure scripts crashes many times due to clang implicitly running wasm-opt for me. I'm using wasi-sdk 33.0 fwiw. I suspect the mismatch in declared prototype & actual function definition is upsetting the tool.

attaching one example program

$ wasm-opt --version
wasm-opt version 130 (version_130)

$ wasm-opt conftest -O2 -o x 
[parse exception: popping from empty stack (at 0:456)]
Fatal: error parsing wasm (try --debug for more info)

$ wasm-opt conftest -O2 -o x --debug
reading...
reading binary from conftest
Loading 'conftest'...
[parse exception: popping from empty stack (at 0:456)]
getNumCores: 4
Assertion failed: *currp (/src/src/wasm-traversal.h: pushTask: 286)
Aborted (core dumped)

conftest.gz

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 20h
Merged PRs (30d)
64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WebAssembly/binaryen

All issues in WebAssembly/binaryen

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.