Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Unable to call method on resource, works in Rust guest but not JS guest

Đang mở
#148 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, rust, wasm
Lĩnh vực
tooling

Hướng nghiên cứu

Tái hiện crash với template cube-js và so sánh với template cube-rust đang hoạt động, tập trung vào dòng 194 của game.js. Sau đó kiểm tra node_modules/@bytecodealliance/ComponentizeJS, tích hợp @rune-runtime/rollup-plugin-rune và trap được báo cáo tại crates/rune/src/runtime/mod.rs:97. Được xem là hoàn tất khi guest JavaScript có thể gọi pipeline.getBindGroupLayout(0) mà không gặp trap unreachable của wasm.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I've got a bit of a challenging one here. It's hard to trace the issue because I don't have debug information available from SpiderMonkey (will traces from the engine be available via some debug mode at some point?)

I have a repro but it requires my toolchain. Shouldn't take long to set up:

  1. Grab the latest rune-cli release from https://github.com/rune-runtime/rune/releases/tag/v0.1.11 (or use curl -fsSL https://rune.sh/install.sh | bash to install rune locally) -- I think you'll need a Mac for this for the time being.
  2. Create a new directory, ie. test & cd into it
  3. Run rune new game --template cube-js -- this will create a new Rune project in the current directory
  4. Run npm i
  5. Run rune run. Observe that the program crashes with [1]
  6. In game.js, comment out line 194 and rune run again. Observe the program does not crash.

This invocation, pipeline.getBindGroupLayout(0) works in my Rust wasm32-wasip1 guest module (you can try it by doing rune new game --template cube-rust) Because of this, I believe there is a bug in ComponentizeJS. Without better debugging I can't say for certain.

If you need to debug the use of ComponentizeJS in my toolchain, you should refer to the module in node_modules/@bytecodealliance/ComponentizeJS, which is used by the @rune-runtime/rollup-plugin-rune Rollup plugin to build a wasm module for Rune.

[1]

Message:  Game didn't initialize: error while executing at wasm backtrace:
    0: 0x2f363 - <unknown>!<wasm function 451>
    1: 0x2f36c - <unknown>!<wasm function 452>
    2: 0x22ee52 - <unknown>!<wasm function 5253>
    3: 0x7a8ac3 - <unknown>!rune:runtime/guest#init

Caused by:
    wasm trap: wasm `unreachable` instruction executed
Location: crates/rune/src/runtime/mod.rs:97

Guidance is appreciated. Thanks.

Ngôn ngữ chính
Rust
Star
392
Fork
54
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bytecodealliance/ComponentizeJS

Tất cả issue của bytecodealliance/ComponentizeJS

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.