Interrupting ctrace leaves the running tool and its run directory behind
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- C++
- Stelle
- 5
- Fork
- 4
- Merge medio
- 1h 9m
- PR unite (30g)
- 81
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CoreTrace/coretrace
-
chore good first issue severity/minor
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
build severity/minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
CoreTrace/coretrace#176 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
build good first issue severity/minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
test: add unit tests for ctrace::RunDirectoryForse già presa @tecnolgd l’ha presa 3 giorni fa. Apertagood first issue test
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
CoreTrace/coretrace#164 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Release a macOS disk image (.dmg) for Apple siliconForse già presa @SizzleUnrlsd l’ha presa 1 giorno fa. Apertabuild enhancement
CoreTrace/coretrace#198 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CoreTrace/coretrace
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
accessibility good first issue hacktoberfest help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
OpenChemistry/avogadrolibs#3184 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tracktion/tracktion_engine#475 ·
I maintainer di solito rispondono entro 1 giorno
-
CB name typo in LMAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
orbiternassp/NASSP#1701 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
redis/memtier_benchmark#732 ·
I maintainer di solito rispondono entro 1 giorno