Skip to content

A real trap of the vector tiles module in the worker test, the sources of the reset-state flag where it is used - #631

Merged
graffkevin merged 1 commit into
mainfrom
vector-tiles-trap-test
Nov 29, 2026
Merged

graffkevin merged 1 commit into
mainfrom
vector-tiles-trap-test

Conversation

@graffkevin

Copy link
Copy Markdown
Collaborator

The worker test of the vector tiles module's trap recovery handed recoverFromTrap a RuntimeError made by hand. It now makes the real module trap: it fills the module's memory so that its allocator traps on the next tile copied in (RuntimeError: Out of bounds memory access), as a bug writing past a buffer would. No export of the module panics on bad input, so this needs no test-only export and no product code. The test checks that:

  • the error is a WebAssembly.RuntimeError from the module;
  • recoverFromTrap takes it, and warns once;
  • the module has a new WebAssembly.Memory afterwards (its instance made again);
  • an ordinary Error (a malformed tile) is not taken for a trap;
  • the next tile goes through the worker and is read by the new instance.

The build script, recoverFromTrap's doc and the dependabot note now say where wasm-bindgen's --experimental-reset-state-function comes from and why wasm-bindgen stays pinned:

Test and comments only: no change of behaviour, no CHANGELOG entry, no performance measurement.

…s of the reset-state flag where it is used

The test overwrote nothing and handed recoverFromTrap a RuntimeError made by hand. It now fills the module's memory
so that its allocator traps on the next tile copied in, checks that recoverFromTrap takes that trap, that the module
has a new memory afterwards, and that the worker reads the next tile with it. The build script, recoverFromTrap's doc
and the dependabot note say where --experimental-reset-state-function comes from and why wasm-bindgen stays pinned.
@graffkevin
graffkevin merged commit 66eff50 into main Nov 29, 2026
9 checks passed
@graffkevin
graffkevin deleted the vector-tiles-trap-test branch November 29, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant