Two things here. First, if the tracer dies before we have time to create
the session on it, the returned value (-1) was not handled creating a
segfault on the following loop.
Second, we no longer assert on the application PID hash table delete
return value since we use add_replace on app. registration creating a
possible key reuse for a different node.
Signed-off-by: David Goulet <dgoulet@efficios.com>
/* 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);
}
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;
}