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

A fatal signal on a worker thread ends only that thread

Đang mở
#476 1 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 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/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ệ
c, linux
Lĩnh vực
operating-systems

Hướng nghiên cứu

Read src/syscall/signal.c and src/syscall/proc.c to trace how a Term or Core default action stops a vCPU, then compare the main-thread and worker paths in src/core/launch.c and src/runtime/forkipc.c. Add the worker-only SIGTERM reproduction described in the issue and extend test-rlimit-cpu for worker-only SIGXCPU. Done means either signal ends the whole thread group with the expected signal status.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When a worker thread dequeues a signal whose default action is Term or Core, elfuse ends that worker and leaves the rest of the thread group running. On Linux, get_signal in kernel/signal.c calls do_group_exit for a fatal signal, so every thread in the group exits regardless of which one took it.

signal_deliver in src/syscall/signal.c returns -1 for a Term or Core default action and sets the exit code, but it does not request a group exit. The run loop in src/syscall/proc.c stops the vCPU on that -1. What happens next depends on the thread: the main thread's path in src/core/launch.c calls proc_request_exit_group whenever its run loop returns, while a worker's path in src/runtime/forkipc.c discards the return value of vcpu_run_loop, runs its robust-list and clear-child-tid cleanup, and exits alone.

RLIMIT_CPU (#475) is the case that exposes it: the sampler queues one SIGKILL at the hard limit and then returns, so if a worker dequeues it, the remaining threads run past the hard limit with nothing left to send it again. A default-action SIGXCPU at the soft limit has the same gap.

Reproduction: the main thread creates a spinning worker, then blocks SIGTERM with pthread_sigmask, sleeps, and sends kill(getpid(), SIGTERM). Only the worker can take the signal. On Linux the process dies with SIGTERM. Reading the code, elfuse ends only the worker and the main thread keeps running.

Follow-ups

  • Request the group exit in delivery: a Term or Core default action taken on any thread ends the whole thread group with that signal's status, as do_group_exit does on Linux.
  • Add a test with the reproduction above: a process-directed SIGTERM that only a worker can take ends the process with SIGTERM.
  • Extend test-rlimit-cpu with a worker-only case: the main thread blocks SIGXCPU and spins, a worker spins with SIGXCPU at its default action, and the process ends with SIGXCPU at the soft limit. A SIGKILL case cannot force the worker, since SIGKILL cannot be blocked.
Ngôn ngữ chính
C
Star
278
Fork
31
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
17

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 sysprog21/elfuse

Tất cả issue của sysprog21/elfuse

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.