Skip to content

wasm-mutate panics when mutating invalid modules #2568

Closed

Description

@alexcrichton

This is something we should probably return an error for or document explicitly, but for example:

$ wasm-tools mutate --seed 0 --reduce <<< "(module (global i32 (global.get 5)))" 

thread 'main' (1242810) panicked at crates/wasm-mutate/src/mutators/modify_const_exprs.rs:99:77:
index out of bounds: the len is 1 but the index is 5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: IOT instruction (core dumped)  wasm-tools mutate --seed 0 --reduce <<< "(module (global i32 (global.get 5)))

or

$ wasm-tools mutate --seed 1 <<< "(module (func global.get 99))"

thread 'main' (1243187) panicked at crates/wasm-mutate/src/mutators/peephole/eggsy/analysis.rs:142:55:
index out of bounds: the len is 0 but the index is 99
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: IOT instruction (core dumped)  wasm-tools mutate --seed 1 <<< "(module (func global.get 99))"

(etc)

Activity

  1. added
    wasm-mutate
    on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasm-mutate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions