Skip to content

Commit bedceab

Browse files
kienanstewartjgalar
authored andcommitted
Fix: lttng-sessiond segfault during session destruction
In `cmd.c:cmd_destroy_session()`, if rotate_size is set for the session, the condition is unsubscribed. During unsubscription, the session's stored value is never nulled out. It could happen that later, after the session is unlocked, the rotate thread may try to do another round of unsubscribe/subscribe, causing a double free of the condition. Change-Id: I183a32224d25345a2088959e6d5c4e41a82d6801 Signed-off-by: Kienan Stewart <kstewart@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
1 parent 42dfde1 commit bedceab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bin/lttng-sessiond/rotate.c

+2
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ int unsubscribe_session_consumed_size_rotation(struct ltt_session *session,
124124
ret = -1;
125125
goto end;
126126
}
127+
session->rotate_condition = NULL;
127128

128129
ret = notification_thread_command_unregister_trigger(
129130
notification_thread_handle, session->rotate_trigger);
130131
if (ret != LTTNG_OK) {
131132
ERR("Session unregister trigger error: %d", ret);
132133
goto end;
133134
}
135+
session->rotate_trigger = NULL;
134136

135137
ret = 0;
136138
end:

0 commit comments

Comments
 (0)