Interrupting ctrace leaves the running tool and its run directory behind
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 50/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- C++
- Estrellas
- 5
- Forks
- 4
- Merge medio
- 1 h 57 min
- PR fusionados (30 d)
- 88
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CoreTrace/coretrace
-
chore good first issue severity/minor
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
build severity/minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
CoreTrace/coretrace#176 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
build good first issue severity/minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Inputs: a file name starting with @ may be read as a response file by the compilerPosiblemente ocupada @SizzleUnrlsd la tomó hace 2 días. Abiertobug severity/minor
CoreTrace/coretrace#203 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Builds without a build type are unoptimized: the README's commands and CI's main jobPosiblemente ocupada @SizzleUnrlsd la tomó hace 4 días. Abiertobuild severity/minor
CoreTrace/coretrace#192 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de CoreTrace/coretrace
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
[BUG] Clipboard History: Buffer over-read in WideCharToMultiByte on double-click pastePosiblemente ocupada @softmgr la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
notepad-plus-plus/notepad-plus-plus#18519 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
justcallmekoko/ESP32Marauder#1635 ·
Los mantenedores suelen responder en 1 día
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
grizzlypeak3d/DJV#931 ·