Fix: registry can be null on lookup
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 6 Feb 2017 20:28:52 +0000 (15:28 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 1 Jun 2017 19:44:11 +0000 (15:44 -0400)
commitbd962bf53a824687d130f15858babd88f425e4db
treeca75fbd6ab0728ad31491d4807570925d64074c8
parente49273dcf0cc67623cea694916c753ebb4272193
Fix: registry can be null on lookup

A session teardown can be initiated by a dying application. Hence, a
session object can exist without a valid registry. As a result,
get_session_registry can return null. To prevent this, the UST
application session lock should be held, when possible, when looking up
the registry to ensure synchronization. Otherwise the presence of a
registry is not guaranteed. In such case, handling a null return value
from look-up registry function is necessary.

Core dumps, triggered by the "assert(registry)" statement found in
reply_ust_register_channel, were observed when killing instrumented
applications. In this occurrence, obtaining the UST application lock
result in a deadlock since the lock is already held during
ust_app_global_create. Handling the null value is simpler and
corresponds with the handling of previous look-up done during the
function.

Handling of null value is also applied to:
add_event_ust_registry
add_enum_ust_registry
ust_app_snapshot_record

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-app.c
This page took 0.025562 seconds and 4 git commands to generate.