Guest ITIMER_REAL never fires in pause() or a spin loop
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/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
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Start with sys_ppoll in src/syscall/poll.c and the timer checks in src/syscall/io.c, then trace how the vCPU watchdog and RLIMIT_CPU sampler kick a guest vCPU in src/syscall/proc.c and issue #475. Add coverage for the reported alarm(1) cases: pause() and a spin loop. Done means both guest processes terminate from SIGALRM near the timer expiry.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A guest alarm() or setitimer(ITIMER_REAL) does not deliver SIGALRM while the guest sleeps in pause() or runs a loop with no syscalls. On Linux both end with SIGALRM when the timer expires.
elfuse keeps the guest ITIMER_REAL in guest_itimer (src/syscall/signal.c) instead of the host timer, since its own vCPU watchdog uses the host setitimer(ITIMER_REAL). The guest timer becomes a pending SIGALRM only when signal_check_timer or signal_check_timer_real runs: after a vCPU exit in src/syscall/proc.c, and inside the fd, futex and retry waits in src/syscall/io.c and src/runtime/futex.c. Two paths reach neither:
sys_ppollinsrc/syscall/poll.cwaits in hostpoll()slices and checkssignal_pending_interruption, but never callssignal_check_timer_real. glibc'spause()isppoll(NULL, 0, NULL, NULL), so it waits forever.- A guest spinning at EL0 takes no exit, so nothing checks the timer until the 10 s vCPU watchdog ends the process with a TIMEOUT crash report.
Reproduction, static aarch64 glibc:
#include <unistd.h>
int main(int argc, char **argv)
{
alarm(2);
if (argc > 1)
for (volatile unsigned long n = 0;; n++)
;
for (;;)
pause();
}
On Linux both ./a.out and ./a.out spin die of SIGALRM after 2 s. Under elfuse on main at e9fdbbb, both were still running when killed at 12 s, with the pause() case parked in sys_ppoll. The result is the same in a fork child and with a second thread that spins or sleeps.
Follow-ups
- Call
signal_check_timer_realin thesys_ppollwait loop and size the slice to the next guest timer expiry, as the fd wait insrc/syscall/io.cdoes. - Have the guest timer kick a spinning vCPU when it expires, the way the RLIMIT_CPU sampler in #475 raises attention, so a compute loop sees SIGALRM on time.
- Add a test:
alarm(1)thenpause(), andalarm(1)then a spin loop, each expected to die of SIGALRM.
- 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ó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
sysprog21/elfuse#476 · 1 bình luận ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cyrusimap/cyrus-imapd#6640 ·
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 60/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GalusPeres/HomeTiles#139 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/nuttx-apps#3942 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
coders/mat.c: ReadMATImageV4 leaves a trailing 0x0 frame, so converting a valid level-4 .mat failsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ImageMagick/ImageMagick#9077 ·
Maintainer thường phản hồi trong vòng 1 ngày