naemon / naemon-livestatus

Naemon - Livestatus Eventbroker Module
GNU General Public License v2.0
26 stars 30 forks source link

fix race condition during core reload on long running queries #55

Closed sni closed 5 years ago

sni commented 5 years ago

reloading naemon while livestatus is still processing a query could lead to a segfault because livestatus is still accessing internal core memory regions which may be freed already. This patch adds a check for the termination flag before each data row. This does not completly solve the issue since it is theoretically still possible but the timeframe is reduced from gathering the complete output which might take while to processing a single data row which is quite fast.

Signed-off-by: Sven Nierlein sven@nierlein.de

sni commented 5 years ago

i think the core does that, but livestatus uses threads.