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

オープン
#137,225 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1週間以上
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, wasm
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
18.4k
フォーク
5.8k
平均マージ
2日 19時間
マージ済み PR(30日)
590

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/runtime のほかの issue

dotnet/runtime の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。