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

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

Maintainer thường phản hồi trong vòng 1 ngày

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
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, wasm
Lĩnh vực
backend

Hướng nghiên cứu

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.

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

Mô tả

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.

Ngôn ngữ chính
Rust
Star
18.9k
Fork
2k
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
238

Chuẩn bị môi trường

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

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

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.