]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed abort when running in foreground but stdin is closed
authorMaria Matejka <mq@ucw.cz>
Sat, 13 May 2023 18:33:35 +0000 (20:33 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 13 May 2023 18:33:35 +0000 (20:33 +0200)
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 <danny@danysek.cz> for reporting.

http://trubka.network.cz/pipermail/bird-users/2023-May/016929.html

sysdep/unix/io-loop.c

index a3b543941840ee19eb4d240f3e6473ccdd79a7cf..58e296a67f58613bd175725334c8ecf641461696 100644 (file)
@@ -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