Fix: clean-up agent app hash table from the main sessiond thread
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 25 Jul 2015 21:48:12 +0000 (17:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 25 Jul 2015 21:48:12 +0000 (17:48 -0400)
commit6a4e403927ffef4cae8726064dcf53c463eb128c
treed351416d6dcd49e0bf7a63b9f0e4e13cdfec4e09
parent3b05775dd0434b4501d4d681610d876fb923e908
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/agent-thread.c
src/bin/lttng-sessiond/agent.c
src/bin/lttng-sessiond/agent.h
src/bin/lttng-sessiond/main.c
This page took 0.02579 seconds and 4 git commands to generate.