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:30:04 +0000 (15:30 -0400)
commitfad1ed2fbb21d3158caa70c35b7b8373d158af11
tree92dec5ec633f0d88f384487b19acb12742dcd458
parent8b3b99e2870d53c97f9ec9a976ed91f43da5f02b
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.026384 seconds and 5 git commands to generate.