From: Jonathan Rajotte Date: Mon, 6 Feb 2017 20:28:52 +0000 (-0500) Subject: Fix: registry can be null on lookup X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=fad1ed2fbb21d3158caa70c35b7b8373d158af11;hp=fad1ed2fbb21d3158caa70c35b7b8373d158af11 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 Signed-off-by: Jérémie Galarneau ---