Stream: general

Topic: Rust target wasm64: invalid table resizable limits flags


view this post on Zulip Linwei Shang (Sep 04 2024 at 16:15):

Reproduce steps

  1. Make sure that a Rust nightly toolchain is available
  2. cargo new wasm64_demo
  3. cargo +nightly build -Z build-std=std,panic_abort --target wasm64-unknown-unknown
  4. The wasm file will be generated in: target/wasm64-unknown-unknown/debug/wasm64_demo.wasm
  5. wasm-tools validate -f memory64 wasm64_demo.wasm

The validation failed with an error like:

error: invalid table resizable limits flags (at offset 0xb7d)

Discussion

Is this a bug of the Rust wasm64 target or the wasmparser crate behind wasm-tools validate?

@Alex Crichton Could you take a look? I found that you are the maintainer of both the Rust wasm64 target and the wasm-tools project.

view this post on Zulip Alex Crichton (Sep 04 2024 at 16:29):

@Linwei Shang what version of wasm-tools aare you using? I ran that command locally and it produced module

view this post on Zulip Alex Crichton (Sep 04 2024 at 16:29):

I believe you're running into something where a "table64" extension was added to the memory64 proposal recently which it looks like LLVM is now using

view this post on Zulip Alex Crichton (Sep 04 2024 at 16:30):

so you might be using a version of wasm-tools from before this extension was implemented

view this post on Zulip Linwei Shang (Sep 04 2024 at 16:36):

You’re absolutely right, that solves the problem.

I was using wasm-tools v1.0.60 which is the latest version from homebrew.
It seems that the homebrew version is outdated.

view this post on Zulip Alex Crichton (Sep 04 2024 at 16:39):

Oh dear yes that's a bit outdated

view this post on Zulip Alex Crichton (Sep 04 2024 at 17:00):

I've not tried this before but I'm trying to update homebrew in https://github.com/Homebrew/homebrew-core/pull/183477

The wasm-tools repository updated how it managed tags and versions at the beginning of 2024 and this updates the livecheck block to locate the new style of tag instead of the old-style tag. The hop...

view this post on Zulip Alex Crichton (Sep 04 2024 at 18:17):

Alex Crichton said:

... I ran that command locally and it produced module

reading over this my typing is sort of awful, I meant to say that it produced a valid module but I think you got the point anyway (sorry about that)

view this post on Zulip Alex Crichton (Sep 04 2024 at 19:51):

ok I think homebrew should be updated and auto-updating again now


Last updated: Oct 23 2024 at 20:03 UTC