[Mono] Null receiver in open virtual delegate invocation crashes the runtime

Đang mở
#137,225 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
Hơn một tuần
Mức phù hợp với người mới
18/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ệ
csharp, wasm
Lĩnh vực
compilers

Hướng nghiên cứu

The failure is a native SIGSEGV in mono_get_addr_compiled_method on Linux ARM64 and a klass assertion in class-accessors.c:73 under the WebAssembly interpreter, both during open virtual delegate invocation with a null receiver. Start from the test OpenDelegate.NullReceiverAfterWarmingUnrelatedVirtualDelegates in src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.cs and the Mono runtime's delegate invoke path. Done means the null-receiver call throws NullReferenceException on Mono and the SkipOnMono attribute can be removed.

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

Mô tả

area-VM-meta-mono runtime-mono untriaged
Description

Invoking an open-instance delegate to a virtual method with a null receiver crashes Mono instead of throwing NullReferenceException.

This was exposed by OpenDelegate.NullReceiverAfterWarmingUnrelatedVirtualDelegates, added in dotnet/runtime#136949. The test creates delegates to virtual methods on two unrelated classes, warms both delegates with valid receivers, then invokes them with null receivers.

Reproduction

Use the test source before its Mono exclusion.

Run OpenDelegate.NullReceiverAfterWarmingUnrelatedVirtualDelegates on Mono. The first null-receiver invocation is:

Assert.Throws<NullReferenceException>(() => second(null, 1, 2, 3, 4));
Expected behavior

The invocation throws NullReferenceException, which the assertion catches. The test passes on CoreCLR.

Actual behavior

Reported CI failures in build 1667003:

  • Mono Linux ARM64: native SIGSEGV in mono_get_addr_compiled_method during the assertion’s lambda; process exits with code 134.
  • Mono WebAssembly interpreter: process aborts on the klass assertion in class-accessors.c:73.

These failures terminate the process rather than raising a catchable managed exception. Other Mono configurations have not been established.

Current mitigation

The test is excluded on Mono using method-level SkipOnMono; CoreCLR and sibling-test coverage remain enabled. Re-enable the test on Mono once null-receiver invocation throws the expected managed exception.

[!NOTE]
This issue description was drafted with GitHub Copilot.

Ngôn ngữ chính
C#
Star
18.4k
Fork
5.8k
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
590

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 dotnet/runtime

Tất cả issue của dotnet/runtime

Issue tương tự

Thêm issue về C#

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.