Skip to content

Stack-switching crash with just enough parameters #13703

Description

@alexcrichton

This script generates a repro.wast file:

python3 -c 'open("repro.wast","w").write(
  "(module\n"
  "  (type $ft (func (param" + " i32"*600 + ")))\n"
  "  (type $ct (cont $ft))\n"
  "  (func $target (type $ft))\n"
  "  (elem declare func $target)\n"
  "  (func (export \"run\") (drop (cont.new $ct (ref.func $target))))\n"
  ")\n"
  "(invoke \"run\")\n")'

which runs as:

$ wasmtime wast \
    -W stack-switching,function-references,async-stack-size=8192,max-wasm-stack=4096 \
    repro.wast
zsh: segmentation fault (core dumped)  wasmtime wast  repro.wast

This is a consequence of #13662 (cc @SebTardif) where the size being tested looks to include the guard page accidentally, concluding the stack is a bit larger than it actually is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions