From 45f3d590846a45836e287dbb208a2fed61db431a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 12 Jun 2019 21:13:18 -0400 Subject: 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 Signed-off-by: Donald Sharp --- lib/lib_errors.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lib_errors.c') diff --git a/lib/lib_errors.c b/lib/lib_errors.c index b6c764d873..e0559f332d 100644 --- a/lib/lib_errors.c +++ b/lib/lib_errors.c @@ -50,6 +50,12 @@ static struct log_ref ferr_lib_warn[] = { .description = "The Event subsystem has detected a slow process, this typically indicates that FRR is having trouble completing work in a timely manner. This can be either a misconfiguration, bug, or some combination therof.", .suggestion = "Gather log data and open an Issue", }, + { + .code = EC_LIB_NO_THREAD, + .title = "The Event subsystem has detected an internal FD problem", + .description = "The Event subsystem has detected a file descriptor read/write event without an associated handling function. This is a bug, please collect log data and open an issue.", + .suggestion = "Gather log data and open an Issue", + }, { .code = EC_LIB_RMAP_RECURSION_LIMIT, .title = "Reached the Route-Map Recursion Limit", -- cgit v1.2.3