rustwasm / walrus

Walrus is a WebAssembly transformation library 🌊🐘
https://docs.rs/walrus
Apache License 2.0
407 stars 65 forks source link

Unknown warning: in name section: index '1' is out of bounds for data #264

Open mrchantey opened 8 months ago

mrchantey commented 8 months ago

Summary

I've started getting this warning from walrus, I've tracked it down here in the source but still cant work out what I'm doing to trigger the error. Everything is working fine, is there a way to clear it? I get it whether using wasm-pack calls or custom wasm-bindgen commands.

[2024-03-17T02:40:29Z WARN  walrus::module] in name section: index `0` is out of bounds for data
[2024-03-17T02:40:29Z WARN  walrus::module] in name section: index `1` is out of bounds for data
guybedford commented 8 months ago

Perhaps try using wasm-tools shrink to reduce the test case here, to share further.

mrchantey commented 8 months ago

Sorry I'm not familiar with wasm-tools, is the command something like wasm-tools shrink path/to/file.wasm?

guybedford commented 8 months ago

wasm-tools shrink --help gives a full end to end example demostrating how to create a predicate.sh script that can pass or fail on variations of the original wasm file.

Alternatively if you want to just share the full binary that can work too.

mrchantey commented 8 months ago

Oh that would be awesome I'm not quite sure where to start 😅 heres the link