From: Jérémie Galarneau Date: Sat, 25 Jul 2015 21:48:12 +0000 (-0400) Subject: Fix: clean-up agent app hash table from the main sessiond thread X-Git-Tag: v2.8.0-rc1~540 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=6a4e403927ffef4cae8726064dcf53c463eb128c;hp=6a4e403927ffef4cae8726064dcf53c463eb128c Fix: clean-up agent app hash table from the main sessiond thread The agent application hash table, which is allocated by the session daemon's main thread, is free'd from the agent application registration thread. This leads to a number of interesting scenarios under which the agent app registration thread may encounter an error, thus tearing itself down and freeing the agent_apps_ht_by_sock hash table. Of course, nothing then prevents the client processing thread from accessing this invalidated hash table to list, enable or disable agent events which leads to crashes or assertions hitting in ht_match_reg_uid(). However, it is not necessary for the agent app registration thread to encounter an error for this to prove problematic. As shown in bug #893, the session daemon's teardown will assert on a NULL key in ht_match_reg_uid() whenever it is performed while a JUL, Log4J or Python event is still enabled in a session. This happens because the session daemon's clean-up triggers the destruction of all sessions. The destruction of those sessions would access the free'd agent_apps_ht_by_sock to disable the registered agent events. Fixes #893 Signed-off-by: Jérémie Galarneau ---