Anastasia-Labs / lucid-evolution

https://anastasia-labs.github.io/lucid-evolution/
22 stars 7 forks source link

WASM Error: Memory access out of bounds #149

Closed nikhils9 closed 4 weeks ago

nikhils9 commented 1 month ago

Complete error:

RuntimeError: memory access out of bounds
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:670612
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2248216
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2240349
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2237935
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2189441
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2491805
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2213847
 ❯ ../../node_modules/.pnpm/@dcspark+cardano-multiplatform-lib-nodejs@5.3.0/node_modules/@dcspark/cardano-multiplatform-lib-nodejs/cardano_multiplatform_lib.js:19117:79

Accompanying error:

Error: recursive use of an object detected which would lead to unsafe aliasing in rust
 ❯ module.exports.__wbindgen_throw ../../node_modules/.pnpm/@dcspark+cardano-multiplatform-lib-nodejs@5.3.0/node_modules/@dcspark/cardano-multiplatform-lib-nodejs/cardano_multiplatform_lib.js:37518:11
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2501206
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2501220
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2211768
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:1633196
 ❯ null.<anonymous> wasm:/wasm/00a747c2:1:2180248
 ❯ ../../node_modules/.pnpm/@dcspark+cardano-multiplatform-lib-nodejs@5.3.0/node_modules/@dcspark/cardano-multiplatform-lib-nodejs/cardano_multiplatform_lib.js:11775:77

So far this error has been observed to occur after successfully submitting a transaction using the Staking Validator design pattern (multiple script inputs being spent along with a withdrawal). The transaction gets successfully confirmed too every time. A reproduction has been added as a test in branch fix/memory-access-out-of-bounds. Once such failed test run

Attaching code snippets for source of these errors in cardano_multiplatform_lib.js:

solidsnakedev commented 4 weeks ago

@nikhils9 try the new version

nikhils9 commented 4 weeks ago

The latest version 0.2.45 fixes this issue. Successful test run