A guest signal does not interrupt futex, epoll_wait or a finite select
Maintainers usually reply within 1 day
@xalestar is already working on this.
Since Sep 13, 2026.
Assessment
This issue has not been assessed yet.
Description
A thread parked in these host waits notices a queued signal only when its
own polling quantum or timeout ends. Linux returns EINTR at once.
PR #377 fixed nanosleep not returning on a queued signal; futex,
epoll_wait and select have the same defect. Measured on Apple M4,
against Linux 6.12 under qemu with HVF.
| signal to handler, median of 12 | elfuse | Linux 6.12 |
|---|---|---|
| nanosleep (after #377) | 0.080 ms | 0.044 ms |
| futex, finite timeout | 40.7 ms | 0.044 ms |
| futex, indefinite | 40.6 ms | 0.044 ms |
| epoll_wait, indefinite | 125 ms | 0.047 ms |
| select, 1 s timeout | 779 ms | 0.050 ms |
| epoll_wait, 1 s timeout | 777 ms | 0.047 ms |
futex re-checks signal_pending on a 100 ms quantum
(FUTEX_OS_SYNC_POLL_CAP_NS) and an indefinite epoll_wait on a 200 ms kevent
slice. A finite select or epoll_wait hands the guest's whole timeout to
pselect or kevent with no wakeup pipe fd and no slice, so the signal waits
for the timeout.
Reproducer: a sibling thread parks in each wait, the main thread sends
SIGUSR1 with pthread_kill after a settle delay, and the handler stamps
CLOCK_MONOTONIC.
- Dominant language
- C
- Stars
- 271
- Forks
- 28
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 27
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 sysprog21/elfuse
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
All issues in sysprog21/elfuse
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Ryan-Millard/Img2Num#681 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tursodatabase/libsql#2285 ·