From: Maria Matejka Date: Sat, 13 May 2023 18:33:35 +0000 (+0200) Subject: Fixed abort when running in foreground but stdin is closed X-Git-Tag: v3.0.0~426 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a3e5c2ae81540ec55ec4e642b50e8db5293c0f6;p=thirdparty%2Fbird.git Fixed abort when running in foreground but stdin is closed A forgotten else-clause caused BIRD to treat some pseudo-random place in memory as fd-pair. This was happening only on startup of the first thread in group and the value there in memory was typically zero ... and writing to stdin succeeded. When running BIRD with stdin not present (like systemd does), it died on this spurious write. Now it seems to work correctly. Thanks to Daniel Suchy for reporting. http://trubka.network.cz/pipermail/bird-users/2023-May/016929.html --- diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index a3b543941..58e296a67 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -1536,7 +1536,8 @@ birdloop_vnew_internal(pool *pp, uint order, struct birdloop_pickup_group *group add_tail(&group->loops, &loop->n); if (EMPTY_LIST(group->threads)) ev_send(&global_event_list, &group->start_threads); - wakeup_do_kick(SKIP_BACK(struct bird_thread, n, HEAD(group->threads))); + else + wakeup_do_kick(SKIP_BACK(struct bird_thread, n, HEAD(group->threads))); UNLOCK_DOMAIN(attrs, group->domain); } else