Closed webmaster128 closed 1 year ago
The 1.0.1 and 1.1.2 releases are probably not affected because the buildes (i.e. Rust version compiling libwasmvm) did not change for them.
I got confirmation from the rkyv chat. It seems to be very likely that the Rust upgrade from 1.65.0 to 1.68.2 changed the (undefined) memory layout of some Rust types, making segfaults during the deserialization of the module the expected behaviour.
This will be fixed in CosmWasm 1.3 and beyond, making it extremely unlikely to happen again. The fix contains two layers:
~/.noded/wasm/wasm/cache/modules/v5-wasmer17/x86_64-nintendo-fuchsia-gnu-coff-01E9F9FE/
instead of ~/.noded/wasm/wasm/cache/modules/v5-wasmer17/
. See https://github.com/CosmWasm/cosmwasm/pull/1664This issue affects more migration paths than I originally thought.
wasmvm | 1.0.0 | 1.0.1 | 1.1.0 | 1.1.1 | 1.1.2 | 1.2.0 | 1.2.1 | 1.2.2 | 1.2.3 |
---|---|---|---|---|---|---|---|---|---|
1.0.0 | – | not affected [^1] | ⚠️ ? | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] |
1.0.1 | – | – | ⚠️ ? | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] |
1.1.0 | – | – | – | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] | not affected [^2] |
1.1.1 | – | – | – | – | not affected [^1] | ⚠️ ? | ⚠️ ? | 🚨 affected | 🚨 affected [^3] |
1.1.2 | – | – | – | – | – | ⚠️ ? | ⚠️ ? | 🚨 affected | 🚨 affected |
1.2.0 | – | – | – | – | – | – | not affected [^1] | 🚨 affected | 🚨 affected |
1.2.1 | – | – | – | – | – | – | – | 🚨 affected | 🚨 affected |
1.2.2 | – | – | – | – | – | – | – | – | not affected [^4] |
1.2.3 | – | – | – | – | – | – | – | – | – |
[^1]: Cherry patch, applies just fine
[^2]: Contains cache invalidation through MODULE_SERIALIZATION_VERSION
[^3]: This hit the Injective mainnet upgrade
[^4]: Same Wasmer and builders version
wasmvm 1.2.4 invalidates all previous caches to avoid potential issues, no matter from which version you are coming.
I consider this done by the 1.2.4 patch release as well as work in 1.3 that will improve the situation even more.
If you upgrade from wasmvm 1.2.{0,1} to wasmvm 1.2.{2,3} please note that most likely the machine format of the compiled Wasm modules has changed. This leads to crashes like the following when the new version is running
To overcome this problem,
~/.noisd/wasm/wasm/cache/
(replace with the location your project uses)You might experience a small slowdown in the beginning since each .wasm code is lazily re-compiled once it is executed.
Thanks a lot to Reece for helping trace that down.