X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=e0562ed4e5448d2e184b288481fad0e80bb77b0b;hp=96f8eb0b3ead316c0defa96905ff40cfcccb3136;hb=5b98a7741b64765b34396a151b976f8f58ee3a5e;hpb=bd69add26f7f847b1d23766ec631f8e3fde4ec7c diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 96f8eb0b3..e0562ed4e 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1506,8 +1506,16 @@ void ust_app_unregister(int sock) /* Assign second node for deletion */ iter.iter.node = <a->pid_n.node; + /* + * Ignore return value since the node might have been removed before by an + * add replace during app registration because the PID can be reassigned by + * the OS. + */ ret = lttng_ht_del(ust_app_ht, &iter); - assert(!ret); + if (ret) { + DBG3("Unregister app by PID %d failed. This can happen on pid reuse", + lta->pid); + } /* Free memory */ call_rcu(<a->pid_n.head, delete_ust_app_rcu); @@ -2555,7 +2563,8 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock) } ua_sess = create_ust_app_session(usess, app); - if (ua_sess == NULL) { + if (ua_sess == NULL || ua_sess == (void *) -1UL) { + /* Tracer is gone for this session and has been freed */ goto error; }