sys_epoll_wait/sys_epoll_pwait2 drop syscalls when 4 FDs ready for operation
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c, linux
- Domain
- devtools, operating-systems
Research direction
The bug is in the syscall-buffering preload code at src/preload/syscallbuf.c, around lines 2827-2828, where the return value of the epoll_wait call is compared against EINTR. Check the same pattern in the sys_epoll_pwait2 handler. Read the linked man page section on return values, then confirm the fix by recording a program that gets four ready file descriptors and checking that no syscalls are dropped. Done means the return check tests -1 and errno instead of the return value.
Written by the indexing model from the issue text.
Description
per https://www.man7.org/linux/man-pages/man2/epoll_wait.2.html
On success, epoll_wait() returns the number of file descriptors
ready for the requested I/O operation, or zero if no file
descriptor became ready during the requested timeout milliseconds.
On failure, epoll_wait() returns -1 and errno is set to indicate
the error.
https://github.com/rr-debugger/rr/blob/master/src/preload/syscallbuf.c#L2827-L2828 (and corresponding code for sys_epoll_pwait2) check the return value of the syscall against EINTR (defined to be 4). This is a bug, and drops syscalls when using rr recording.
Instead, ret should be checked against -1, and errno against EINTR.
Thanks to my AI for finding this bug 😅
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 666
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 32
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rr-debugger/rr
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
rr-debugger/rr#4146 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 43/100
rr-debugger/rr#4127 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rr-debugger/rr#4060 · 5 comments ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rr-debugger/rr#4059 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rr-debugger/rr#4047 · 4 comments ·
Maintainers usually reply within 2 days
Similar issues
-
Favicons are coolOpenenhancement frontend
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Spot Capacity Round Trips tests accept the two largest rising runsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
project: hipblaslt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ROCm/rocm-libraries#15746 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
bazel-contrib/rules_go#4784 · 1 comment ·
Maintainers usually reply within 1 day