Interrupting ctrace leaves the running tool and its run directory behind
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 50/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- C++
- Stars
- 5
- Forks
- 4
- Avg merge
- 1h 10m
- Merged PRs (30d)
- 79
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CoreTrace/coretrace
-
chore good first issue severity/minor
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
build severity/minor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
CoreTrace/coretrace#176 · 1 comment ·
Maintainers usually reply within 1 day
-
build good first issue severity/minor
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
test: add unit tests for ctrace::RunDirectoryPossibly taken @tecnolgd claimed this 2 days ago. Opengood first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
CoreTrace/coretrace#164 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Builds without a build type are unoptimized: the README's commands and CI's main jobPossibly taken @SizzleUnrlsd claimed this 1 day ago. Openbuild severity/minor
CoreTrace/coretrace#192 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in CoreTrace/coretrace
Similar issues
-
agent:Windows bug code-review LOW testing
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
[Cleanup] Include the public header in work_split.cppPossibly taken @blozano-tt claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tenstorrent/tt-metal#60850 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
beehive-lab/TornadoVM#1248 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SimVascular/svZeroDSolver#253 ·
-
core: RAC_LLM_OPTIONS_DEFAULT.min_p disagrees with the IDL's annotated defaultPossibly taken A pull request linked to this issue is open or already merged. Openbug core p3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Maintainers usually reply within 5 days