A fatal signal on a worker thread ends only that thread
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_exitdoes 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-cpuwith 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
- 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 sysprog21/elfuse
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của sysprog21/elfuse
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InukaAsith/TwinDesk#84 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/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 78/100
CanadaHonk/porffor#426 ·