Fix: sessiond: ust-app: assertion failure on registration of dead app
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 2 Apr 2021 17:11:34 +0000 (13:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 2 Apr 2021 19:38:59 +0000 (15:38 -0400)
While setting up the event notifier group of a newly registered
application (see `ust_app_setup_event_notifier_group()`), communications
with the application can fail (generally because the application exited)
while sending the error counter configuration. This causes the UST
handle to the event notifier group to be released.

However, a second release is performed which results in undefined
behaviour (I have seen it succeed, assert, and crash under different
circumstances) while disposing of the application (see
`delete_ust_app()`).

Set the event notifier group ust handle to NULL to mark it as invalid
and prevent a second release during the clean-up.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia5623a8d3f57174effa51c278e9654b6adc43289

src/bin/lttng-sessiond/ust-app.c

index d8546308deb2cc2fa77e7c1b698627626b881234..b5ee6126eee1ae214a43ca3a5842bf3a5fdab079 100644 (file)
@@ -4070,6 +4070,7 @@ int ust_app_setup_event_notifier_group(struct ust_app *app)
 error:
        ustctl_release_object(app->sock, app->event_notifier_group.object);
        free(app->event_notifier_group.object);
+       app->event_notifier_group.object = NULL;
        return ret;
 }
 
This page took 0.035907 seconds and 4 git commands to generate.