engine: fix SIGSEGV while flb_shutdown() on select/libevent backend (#1085)
engine: fix SIGSEGV while flb_shutdown() on select/libevent backend (#1085)

The root problem was that flb_shutdown() could emit an event while
closing ch_manager pipes, because select(2) would consider a closed
socket as "ready to read".

Since many resources has been deallocated already at that point, the
event callback dives directly into SIGSEGV and crashes.

This patch tries to fix the issue by skipping event processing if
flb_shutdown() has been already initiated.

Signed-off-by: Fujimoto Seiji <ef879192bb1e41d519c82cf76440dc8e9a530806@clear-code.com>
nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit