From 88631abdb47f19cef324197fee9b21718a307808 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 2 Apr 2021 13:11:34 -0400 Subject: [PATCH] Fix: sessiond: ust-app: assertion failure on registration of dead app MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ia5623a8d3f57174effa51c278e9654b6adc43289 --- src/bin/lttng-sessiond/ust-app.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index d8546308d..b5ee6126e 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -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; } -- 2.34.1