WebAssembly / WebAssembly/binaryen

The wasm-reduce tool encountered an abnormal timeout under the condition of "--command=./wasmer run test.wasm"

Open
#7,864 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Phenomenon description

Hello, when I use the wasm-reduce tool to shorten the wasm program, there is an abnormal timeout. The command in --command exits normally when executed separately in the terminal, and the exit code is 0. But when using the wasm-reduce tool, the execution is as follows:

Image

Commands from other runtime tools can be executed normally, as follows:

Image
Steps to reproduce
// hello_world.c
#include <stdio.h>
int main() {
  printf("Hello, world!\n");
  return 0;
}
emcc hello_world.c -o hello_world.wasm -O2 -s WASM=1
/bin/wasm-reduce hello_world.wasm "--command=/path/to/wasmer run test.wasm" -t test.wasm -w work.wasm
Versions and Environment

binaryen is built from source.

  • wasm-reduce: version 123 (version_123-229-g6f4e4f7d0)
  • wasmer: 6.0.1
  • emcc: 4.0.10 (b7dc6e5747465580df5984e723b9d1f10d8e804b)
  • wabt: 1.0.27
  • Host OS: Ubuntu 22.04.5 LTS x64
  • CPU: 12th Gen Intel® Core™ i7-12700 × 20
Extra Info

If you need any other relevant information, please let me know and I will do my best to provide it. Looking forward to your reply! Thank you!

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.

Research direction

Start by reproducing the timeout with hello_world.c, test.wasm, work.wasm, and the reported wasm-reduce command, then compare it with the separately working runtime commands. Trace the wasm-reduce command-execution path and verify completion when using wasmer; done means the provided reduction no longer reports an abnormal timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.