Interrupting ctrace leaves the running tool and its run directory behind
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start with the process spawning in include/Process/UnixProcess.hpp around lines 68-77, where the tool gets its own process group, and with the RunDirectory cleanup. Then find where POST /shutdown drains server mode so the signal path can reuse it. Done means that after Ctrl+C or SIGTERM no tool process or run directory remains, the exit codes are 130 and 143, and an integration test with a hung fake tool checks both.
索引モデルが issue の本文から書いたものです。
説明
Interrupting ctrace while an external tool runs stops ctrace but not the tool: the tool keeps running, orphaned, and the run directory stays in the temporary directory.
Observed
main eba7f88, macOS 15.6.1. A fake cppcheck that sleeps 600 s is first in PATH; ctrace --input ok.c --invoke cppcheck is interrupted after 2 s:
| Signal | Sent to | ctrace |
Tool process | Run directory |
|---|---|---|---|---|
| SIGINT (Ctrl+C) | the process group | exits 130 within 1 s | still running | left behind |
| SIGTERM | the process group | exits 143 at once | still running | left behind |
| SIGINT | ctrace only |
exits 130 within 1 s | still running | left behind |
| SIGTERM | ctrace only |
exits 143 at once | still running | left behind |
Each interrupted run leaves one ctrace-cppcheck-* directory in $TMPDIR. A server stopped with SIGINT or SIGTERM also exits at once, without the drain that POST /shutdown performs.
Cause
ctraceinstalls no signal handler: SIGINT and SIGTERM take their default action, so no destructor runs (RunDirectoryis not removed).- With a timeout, which every external tool has by default, the tool is started in its own process group (
include/Process/UnixProcess.hpp:68-77), so the terminal's Ctrl+C does not reach it, and nothing kills it whenctracedies.
Fix
On SIGINT and SIGTERM, stop the running tools (SIGTERM to their process group, then SIGKILL after a grace period), let the run directories be removed, and exit with 128 + the signal. In server mode, start the same drain as POST /shutdown.
Acceptance
- After Ctrl+C or SIGTERM during a run, no tool process and no run directory remain.
- The exit code is 130 for SIGINT and 143 for SIGTERM.
- An integration test interrupts a run with a hung fake tool and checks both.
Found by the resilience campaign (docs/quality/resilience.md, scenarios C31 to C34, S18, S21).
- 主要言語
- C++
- スター
- 5
- フォーク
- 4
- 平均マージ
- 1時間 57分
- マージ済み PR(30日)
- 88
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CoreTrace/coretrace のほかの issue
-
chore good first issue severity/minor
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
build severity/minor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
CoreTrace/coretrace#176 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
build good first issue severity/minor
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Inputs: a file name starting with @ may be read as a response file by the compiler対応中かも @SizzleUnrlsd が 2 日前に担当しました。 オープンbug severity/minor
CoreTrace/coretrace#203 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Builds without a build type are unoptimized: the README's commands and CI's main job対応中かも @SizzleUnrlsd が 4 日前に担当しました。 オープンbuild severity/minor
CoreTrace/coretrace#192 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
CoreTrace/coretrace の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
grizzlypeak3d/DJV#931 ·
-
bug 🔥 pharesee
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
BoundedVector::insert assigns to slots that were never constructed対応中かも @auraseb が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
philips-software/amp-embedded-infra-lib#1379 ·
メンテナーはふだん 2 日以内に返信