SPLICE_F_NONBLOCK can block on a pipe shared with another process
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c, macos
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Start in src/syscall/io.c and read the io_xfer, io_xfer_once, sys_splice, and splice_drain_chunk paths described in the issue. Compare the input and output pipe races, then investigate macOS pipe APIs for a per-operation nonblocking transfer that preserves data already read. Done means SPLICE_F_NONBLOCK returns without parking the vCPU in both races, without changing nonblocking behavior for other processes sharing the pipe.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
splice with SPLICE_F_NONBLOCK can still block when another process works on the same pipe between a readiness check and the host transfer. There are two windows, both in src/syscall/io.c:
- Input: on a pipe that elfuse does not own (for example inherited stdin),
io_xferanswers a per-call nonblocking read withpoll(0)and then a plainread. When a sibling process drains the pipe between the two calls and the writer stays open, thereadparks the vCPU thread, so the splice hangs instead of returning EAGAIN, and guest signal and teardown checks cannot run. A socket input is not affected, becauseio_xfer_oncealready passesMSG_DONTWAIT. - Output: before each read,
sys_splicechecks the output pipe's free room withpollandfstat, but that reserves nothing. When another writer fills the pipe between the check and the write, the chunk has already been read, andsplice_drain_chunkblocks inio_xferon the output despite the flag.
Linux holds the pipe lock across the check and the transfer. macOS has no per-call nonblocking read or write for a pipe, and setting O_NONBLOCK on the description would change it for every process that shares it. Making the output write nonblocking would close the second window, but it would lose the chunk already taken from a pipe or socket input.
Found in review on #463, where both windows are now stated in the code comments.
- 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ó 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
Tất cả issue của sysprog21/elfuse
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
ly05010419/MacNativeGames#1340 ·
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 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