Race between ust app list and register done command
The "lttng list -u" (lttng_list_tracepoints()) does NOT require a session thus does NOT lock the session list lock and then call the ust app list event function that iterates over the application hash table. However, an application can be in the process of being registered and it's added in the hash table BEFORE the register done command is received from the application thus creating a race window between that expected command and a list command that does not require any lock.
Note, the register done process is protected by the session list lock so we can use sessions safely during a new application registration.
1) Use the session list lock for the list tracepoints command.
2) Add a lock that protects the app add command + register done BUT that would require every call site that uses the ust app HT to lock it.
3) Somehow figure out how we can add the application to the HT after the registration is done. Right now, a comment explains why we need it before.
/* * Add application to the global hash table. This needs to be * done before the update to the UST registry can locate the * application. */ ust_app_add(app);