In-process (.NET, Windows): access violation in copilot_runtime_connection_write when responding to runtime requests
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 43/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- csharp, typescript
調査の方向性
Start by tracing the .NET in-process response path from FfiRuntimeHost.SendFrame through JsonRpc.SendResultResponseAsync, then inspect the native copilot_runtime_connection_write implementation and its connection lifecycle. Try to reproduce on Windows x64 with parallel MCP tool calls using the reported SDK/runtime versions; done means writes either succeed or report a managed error without crashing the host.
索引モデルが issue の本文から書いたものです。
説明
Summary
With in-process hosting (RuntimeConnection.ForInProcess()) on Windows x64, the host process dies with an access violation (0xC0000005) inside the native copilot_runtime_connection_write while the .NET SDK writes a response frame. It happens mid-turn in long agent sessions and takes down the whole host application.
Versions
GitHub.Copilot.SDK1.0.16 (runtime 1.0.89) and 1.0.17 (runtime 1.0.93); reproduced on both- .NET 10, win-x64, self-contained WPF app, in-process hosting
- Session config:
OnPreToolUsehook (synchronous, returns allow),OnPermissionRequesthandler (synchronous allow),OnUserInputRequest,OnElicitationRequest, an HTTP MCP server with many tools,AskUserVariant.Elicitation, a custom provider pointed at a loopback HTTP endpoint
Stack (1.0.17)
Fatal error.
0xC0000005
at GitHub.Copilot.FfiRuntimeHost.<ConnectionWrite>g____PInvoke|55_0(UInt32, Byte*, UIntPtr)
at GitHub.Copilot.FfiRuntimeHost.SendFrame(System.ReadOnlySpan`1<Byte>)
at GitHub.Copilot.JsonRpc+<SendMessageAsync>d__35`1[[System.__Canon, ...]].MoveNext()
at GitHub.Copilot.JsonRpc+<SendResultResponseAsync>d__46.MoveNext()
at GitHub.Copilot.JsonRpc.SendResultResponseAsync(System.Text.Json.JsonElement, System.Object, System.Type, System.Threading.CancellationToken)
at GitHub.Copilot.JsonRpc+<HandleIncomingMethodAsync>d__41.MoveNext()
at GitHub.Copilot.JsonRpc+<ReadLoopAsync>d__37.MoveNext()
...
at GitHub.Copilot.JsonRpc+<ReadMessageAsync>d__39.MoveNext()
...
at GitHub.Copilot.FfiRuntimeHost+CallbackReceiveStream+<ReadAsync>d__4.MoveNext()
...
at GitHub.Copilot.FfiRuntimeHost+CallbackReceiveStream+<ReadCoreAsync>d__5.MoveNext()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
On 1.0.16 the same fault came through JsonRpc.SendMessageAsync from CopilotSession.HandlePendingPermissionRequestAsync.
Pattern
Both crashes happened right after the model issued two MCP tool calls in parallel. The host log shows two preToolUse approvals, then two permission-request approvals, then an MCP HTTP call returning 200, and then the fault while writing a response frame back to the runtime. FfiRuntimeHost.SendFrame already holds _lifecycleLock and checks _disposed and _connectionId, so the managed side does not seem to be writing concurrently or after close. The fault appears to be in the native write path.
Frequency: about 1 crash in 15–20 multi-tool conversations when replaying real user sessions (each 1–4 turns, 10–60 tool calls). Single-turn tests and a 40-turn sequential stress run did not reproduce it, so concurrency between parallel tool calls looks like a factor.
Possibly related: on 1.0.16 we also saw one turn hang forever. The session's events.jsonl had hook.start for preToolUse with no matching hook.end, even though our hook returns synchronously.
Expected
A response write to an open connection either succeeds or fails with a managed error. It should never crash the host process.
Happy to run a build with extra native logging if that helps.
- 主要言語
- Java
- スター
- 10.7k
- フォーク
- 1.5k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/copilot-sdk のほかの issue
-
Rust: ElicitationRequest drops the tool call id from elicitation.requested再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/copilot-sdk#2900 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
github/copilot-sdk#2876 · コメント 1 件 · リアクション 1 件 ·
-
Python ModelLimits drops max_output_tokens from model metadata再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/copilot-sdk#2798 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/copilot-sdk#2759 ·
-
docs/AGENTS.md is repo authoring guidance, but everything in docs/ gets published再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
github/copilot-sdk#2758 ·
github/copilot-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ls1intum/thesis-management#1473 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
LunaDeerMC/Dominion#301 · コメント 1 件 ·
-
[FEATURE] Expose external refresh, node-level translog and warmer stats対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンuntriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信