diff options
| author | 2026-11-19 21:46:54 +0200 | |
|---|---|---|
| committer | 2026-11-19 21:46:54 +0200 | |
| commit | 1498dee3aadf66dbae10e699d71c62b428a511a3 (patch) | |
| tree | f666f66fadaceaaf1378ffada69c5f4d9b8999c9 /m4 | |
| parent | cf4b806dff1003e56b8219367bbb29cb01c3f619 (diff) | |
| download | libusbmuxd-master.tar.gz libusbmuxd-master.tar.bz2 | |
When usbmuxd isn't running, the device_monitor thread waits for the
socket to appear by select()ing on an inotify fd. In a long-lived
process with many open descriptors (e.g. KDE's kwin_wayland, which
loads libusbmuxd via Solid's iMobileDevice backend), that fd can be
>= FD_SETSIZE (1024). FD_SET() on it is undefined behaviour, and with
_FORTIFY_SOURCE glibc aborts the whole process:
*** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated
#8 __fortify_fail (libc)
#9 usbmuxd_listen_inotify src/libusbmuxd.c:944
#10 device_monitor src/libusbmuxd.c:1130
Here this took down the Wayland compositor (and with it the whole
desktop session) after ~4 weeks of uptime, when typing in the Overview
search triggered a KRunner plugin that initialised Solid.
poll() has no descriptor limit. This replaces the pselect() call with
poll() on the inotify fd and the wake pipe; the pselect() fallback shim
and the <sys/select.h> include become unused and are removed.
libimobiledevice-glue's socket code already uses poll() on non-Windows
platforms for the same reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions
