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

Abierto
#15,256 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust, wasm
Área
backend

Línea de trabajo

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.

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

Descripción

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.

Lenguaje dominante
Rust
Estrellas
18.9k
Forks
2k
Merge medio
1 d 6 h
PR fusionados (30 d)
238

Preparar el entorno

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/wasmtime

Todos los issues de bytecodealliance/wasmtime

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.