/* 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);
int ust_app_create_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
+ int ret = 0;
struct lttng_ht_iter iter;
struct ust_app *app;
struct ust_app_session *ua_sess;
ua_sess = create_ust_app_session(usess, app);
if (ua_sess == NULL) {
/* The malloc() failed. */
+ ret = -1;
goto error;
} else if (ua_sess == (void *) -1UL) {
/* The application's socket is not valid. Contiuing */
+ ret = -1;
continue;
}
ua_chan = create_ust_app_channel(ua_sess, uchan, app);
if (ua_chan == NULL) {
/* Major problem here and it's maybe the tracer or malloc() */
+ ret = -1;
goto error;
}
}
rcu_read_unlock();
- return 0;
-
error:
- return -1;
+ return ret;
}
/*
}
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;
}