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

Abierto
#148 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript, rust, wasm
Área
tooling

Línea de trabajo

Reproduce el crash con la plantilla cube-js y compárala con la plantilla funcional cube-rust, centrándote en la línea 194 de game.js. Después, inspecciona node_modules/@bytecodealliance/ComponentizeJS, la integración de @rune-runtime/rollup-plugin-rune y el trap informado en crates/rune/src/runtime/mod.rs:97. Se considera terminado cuando el guest de JavaScript pueda llamar a pipeline.getBindGroupLayout(0) sin el trap unreachable de wasm.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
392
Forks
54
Merge medio
2 d 18 h
PR fusionados (30 d)
3

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bytecodealliance/ComponentizeJS

Todos los issues de bytecodealliance/ComponentizeJS

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.