]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: don't assert on worker cap after killing a broken idle worker 41758/head
authorDaan De Meyer <daan@amutable.com>
Tue, 21 Apr 2026 08:44:44 +0000 (08:44 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 Apr 2026 19:14:08 +0000 (21:14 +0200)
commit181a9f65a7cf9059da0f2a44e2152d7636446b33
treeddf123a678be948351a82fd1d06ae1444f4606ed
parentb2d72eabcde260088f1ab681d3893e14860a9c22
udev: don't assert on worker cap after killing a broken idle worker

manager_can_process_event() considers an event processable if either
there is room below children_max to spawn, or an idle worker exists.
When only the latter holds, event_run() picks the idle worker and
tries device_monitor_send(). If that send fails, event_run() SIGKILLs
the worker, marks it WORKER_KILLED and continues the loop. With no
other idle worker available, it falls through to worker_spawn(),
guarded by:

    assert(hashmap_size(manager->workers) < manager->config.children_max);

The just-killed worker is still in manager->workers until its SIGCHLD
is reaped by on_worker_exit(), so at the cap this assertion trips and
udevd aborts:

    Assertion 'hashmap_size(manager->workers) < manager->config.children_max'
    failed at src/udev/udev-manager.c:635, function event_run(). Aborting.

Instead of asserting, bail out when we are already at the worker
limit. The event remains in EVENT_QUEUED; once the killed worker's
SIGCHLD arrives and frees it from the hashmap, on_post() re-runs
event_queue_start() and the event is retried.
src/udev/udev-manager.c