From: Jérémie Galarneau Date: Fri, 2 Apr 2021 17:11:34 +0000 (-0400) Subject: Fix: sessiond: ust-app: assertion failure on registration of dead app X-Git-Tag: v2.13.0-rc1~167 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=88631abdb47f19cef324197fee9b21718a307808;p=lttng-tools.git Fix: sessiond: ust-app: assertion failure on registration of dead app 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 --- 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; }