Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Interrupting ctrace leaves the running tool and its run directory behind

Đang mở
#188 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@SizzleUnrlsd đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #206 của @SizzleUnrlsd — đang mở

Đá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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
backend, cli

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ả

bug severity/major

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

  • ctrace installs no signal handler: SIGINT and SIGTERM take their default action, so no destructor runs (RunDirectory is 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 when ctrace dies.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CoreTrace/coretrace

Tất cả issue của CoreTrace/coretrace

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.