Core dump of a trapping global initializer hits a debug assertion on non-nullable reference globals

Aperta
#15,256 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, wasm
Ambito
backend

Direzione di ricerca

Start with the panic at crates/wasmtime/src/runtime/externals/global.rs:237 and reproduce it using the WAT module and wasmtime command in the issue. Trace how globals are represented when instantiation traps before initialization completes, and how core-dump serialization reads them. Done means serializing this partial instance no longer hits the non-nullable-reference assertion and the dump can reflect the trapped state.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

wasm-proposal:gc

If a global initializer traps during instantiation, serializing the resulting core dump panics in debug builds when a later global has a non-nullable reference type:

(module
  (type $a (array i64))
  (global $g0 (ref $a) (array.new_default $a (i32.const 0x7fffffff)))
  (global $g1 (ref $a) (array.new_default $a (i32.const 1))))
$ wasmtime run -W gc=y -D coredump=out.core repro.wat

thread 'main' panicked at crates/wasmtime/src/runtime/externals/global.rs:237:21:
if the type is non-nullable, we better have a non-null reference

This is sort of a more general problem where instances are left in a half-baked state on trapping during instantiation which means that we don't have a great way to reflect over them in a core dump. At the same time, however, reflecting over a core dump is exactly what you'd want in such a situation.

My guess is that this is probably also a problem for the guest-debug feature where inspecting globals on a trap might get wonky if everything's not fully initialized.

Lingua principale
Rust
Stelle
18.9k
Fork
2k
Merge medio
1g 6h
PR unite (30g)
238

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bytecodealliance/wasmtime

Tutte le issue di bytecodealliance/wasmtime

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.