Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Windows sandbox: a command that fails before starting leaves sandbox-helper.exe running

クローズ 初心者向け
#162 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust, typescript
領域
desktop, testing

調査の方向性

src/main/tools/sandbox_windows.tsのHelperProcess.fail()とsandbox_windows.test.ts:291のfake-helperテストから始め、native/sandbox-helper/src/win.rs:216-252にある実際のhelperのstdin EOF時の動作と比較してください。stdinが閉じられるまでfake helperが終了しないように更新し、その後fail()の後にhelperが終了することを確認して、Windows sandboxのテストを実行してください。

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

説明

bug platform: windows priority: high severity: high

Found in the 2026-10-07 code review (traced on both the TypeScript and Rust sides).

Problem

HelperProcess.finish() (src/main/tools/sandbox_windows.ts:365-377) ends the helper's stdin, but fail() (:356-363) does not. The helper's serve loop (native/sandbox-helper/src/win.rs:216-252) only exits when stdin reaches EOF. After run() returns Err, it sends Error{id} and waits for more input. ShellRunner treats 'error' as finished and never calls killTree. Background entries get exitCode = null, so stopBackground skips them too.

Scenario

Every error before the command starts leaves one idle helper process with three pipes: a lock timeout, missing git metadata, a CreateAppContainerProfile/CreateProcessW failure, no free drive letter, or a cancel during preparation. A model that retries a failing command piles them up until Patch quits.

Why the tests miss it

The fake helper in sandbox_windows.test.ts:291 calls process.exit(0) after sending error. The real helper doesn't exit.

Fix

private fail(message: string): void {
  if (this.done) return;
  this.done = true;
  this.helper.stdin?.end();   // the helper exits once its input closes
  this.stdout.end();
  this.stderr.end();
  this.emit('error', new Error(message));
  this.emit('close', null);
}

Make the fake helper stay alive until its stdin closes, and assert that the helper process exited after fail().

主要言語
TypeScript
スター
2
フォーク
2
平均マージ
8時間 28分
マージ済み PR(30日)
26

環境構築

はじめの一歩

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

PierrunoYT/patch のほかの issue

PierrunoYT/patch の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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