]> git.puffer.fish Git - mirror/frr.git/commit
lib: Prevent infinite loop in fd handling
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 13 Jun 2019 01:13:18 +0000 (21:13 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 13 Jun 2019 19:14:04 +0000 (15:14 -0400)
commit45f3d590846a45836e287dbb208a2fed61db431a
tree17e5fcbb43d38b7c022d8e28a19145ff6ebcec54
parent42aac9b2abe62b3eae952ba690bdec855edc1ba7
lib: Prevent infinite loop in fd handling

If we have a case where have created a fd for i/o and we have
removed the handling thread but still have the fd in the poll
data structure, there existed a case where we would get
the handle this fd return from poll but we would immediately
do nothing with it because we didn't have a thread to hand
the event to.

This leads to an infinite loop.  Prevent the infinite loop
from happening and log the problem.

We still need to find the cause of this happening.  But
let's prevent the system from melting down in the mean time.

Fixes: #2796
Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/lib_errors.c
lib/lib_errors.h
lib/thread.c