Interrupting ctrace leaves the running tool and its run directory behind
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- C++
- Star
- 5
- Fork
- 4
- Merge trung bình
- 1 giờ 57 phút
- Pull request đã merge (30 ngày)
- 88
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CoreTrace/coretrace
-
chore good first issue severity/minor
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
build severity/minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CoreTrace/coretrace#176 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
build good first issue severity/minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Inputs: a file name starting with @ may be read as a response file by the compilerCó thể đã có người làm @SizzleUnrlsd đã nhận 2 ngày trước. Đang mởbug severity/minor
CoreTrace/coretrace#203 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Builds without a build type are unoptimized: the README's commands and CI's main jobCó thể đã có người làm @SizzleUnrlsd đã nhận 3 ngày trước. Đang mởbuild severity/minor
CoreTrace/coretrace#192 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CoreTrace/coretrace
Issue tương tự
-
bug question
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
-
test(python): the CPU-bound tool overlap check compares two wall-clock samples and fails under loadĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CachyOS/New-Cli-Installer#50 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
Qiskit/qiskit-aer#2482 ·
Maintainer thường phản hồi trong vòng 1 ngày