-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(execution): Canister snapshots should include Wasm globals #1250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the same problem exists for the fields ExecutionState::exports
and ExecutionState::metadata
.
Why do you think so? |
Aren't they also extracted from the wasm and should therefore be restored when the wasm is restored? I might be mistaken of course, you know that code better. |
I believe the exports and metadata should be restored from the restored Wasm module. And I guess that's why we missed globals... |
I got it wrong then and it's all good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, @luc-blaeser!
rs/execution_environment/src/execution_environment/tests/canister_snapshots.rs
Outdated
Show resolved
Hide resolved
Using IC 2024-08-16 with some adjustments: * `drun` adjustments for better testing - dfinity/ic#662 (Lift 8GB memory boundary from drun) - dfinity/ic#988 (Enable Wasm64 with 16GB main memory capacity) - dfinity/ic#991 (Disable DTS for deterministic debug outputs) - dfinity/ic#992 (Increase batch limit for longer running tests) - dfinity/ic#1240 (Enable canister snapshots) * IC build fixes for `nix`: - Remove duplicate entries of same crate with same versions in `Cargo.toml`. - dfinity/ic#993 (Fix MacOS `rocksdb` dependency). * Other IC fixes: - dfinity/ic#1250 (Fix canister snapshots)
…ty#1250) Currently, the canister snapshots do not cover the state of Wasm global variables, such that in realistic canister programs with mutable global variables, the state is not properly recovered when a snapshot is loaded. This fix adds the Wasm globals to the snapshot state, similar to the execution state. (Side note: All Wasm variables are exported by the Wasm instrumentation.)
Currently, the canister snapshots do not cover the state of Wasm global variables, such that in realistic canister programs with mutable global variables, the state is not properly recovered when a snapshot is loaded.
This fix adds the Wasm globals to the snapshot state, similar to the execution state. (Side note: All Wasm variables are exported by the Wasm instrumentation.)