Repository navigation
chore: turn some embedder panics into errors - #10593
Merged
Merged
Conversation
schneiderstefan
approved these changes
Jun 29, 2026
|
✅ No security or compliance issues detected. Reviewed everything up to 7418071. Security OverviewDetected Code Changes
|
pull Bot
pushed a commit
to mikeyhodl/ic
that referenced
this pull request
Jul 16, 2026
This PR implements regression tests for this [PR](dfinity#10593). Unit tests (`rs/execution_environment/tests/canister_snapshots.rs`): 1. `upload_and_load_snapshot_with_wasm_memory` — Uploads a snapshot declaring 2 MiB (32 pages) of wasm memory for a `(memory 1 1)` module, loads it, and asserts inc fails gracefully (the 1-page max can't grow to 32). 2. `upgrade_with_keep_heap_exceeds_module_max_fails_gracefully` — Installs a 20-page module with orthogonal persistence, upgrades to `(memory 1 1)` with `wasm_memory_persistence: Keep`, and asserts the retained 20-page heap exceeding the new 1-page max fails gracefully. System test (`rs/tests/execution/general_execution_tests/canister_snapshots.rs`): 3. `upload_and_load_snapshot_with_wasm_memory` — The end-to-end mirror of unit test #1: same setup driven over the public API against an application subnet (heap uploaded in 1 MiB chunks), asserting inc fails gracefully rather than panicking the replica. All three exercise the same code path — the embedder returning `IC0521 ("Failed to grow wasm memory … exceeds module's declared maximum")` instead of the old `.expect("memory grow failed")` panic. --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR turns some embedder panics into errors. The motivation for this change is defense-in-depth - an error has a smaller blast radius.