From: Francis Deslauriers Date: Mon, 13 Jul 2020 17:43:59 +0000 (-0400) Subject: Fix: src.ctf.lttng-live: overwrite of error status trips `BT_ASSERT()` X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=535fb48a33f404e13d8ec0c9d291b4e00d6b40c6;hp=535fb48a33f404e13d8ec0c9d291b4e00d6b40c6;p=babeltrace.git Fix: src.ctf.lttng-live: overwrite of error status trips `BT_ASSERT()` Issue ===== While tracking a bug in the LTTng Consumer daemon we witness an assertion failure of Babeltrace: # Test ust streaming live clear with viewer # Parameters: tracing_active=1, clear_twice=1, buffer_type=uid ok 253 - Create session Yi7ksFEZ76dwwd4m with uri:net://localhost and opts: --live ok 254 - Enable channel chan for session Yi7ksFEZ76dwwd4m ok 255 - Enable ust event tp:tptest for session Yi7ksFEZ76dwwd4m ok 256 - Start tracing for session Yi7ksFEZ76dwwd4m # Waiting for live trace at url: net://localhost ok 257 - Waiting for live trace at url: net://localhost # Waiting for live viewers on url: net://localhost ok 258 - Waiting for live viewers on url: net://localhost 07-10 15:14:20.932 13745 13745 E PLUGIN/SRC.CTF.LTTNG-LIVE/VIEWER lttng_live_get_stream_bytes@viewer-connection.c:1601 [lttng-live] Received get_data_packet response: unknown (╯°□°)╯︵ ┻━┻ msg-iter.c:491: request_medium_bytes(): Assertion `buffer_sz != 0` failed The issue is that even when the `lttng_live_get_stream_bytes()` function fails miserably because of an unknown status code, it could return a `CTF_MSG_ITER_MEDIUM_STATUS_OK`. This happens because we are calling the `viewer_status_to_ctf_msg_iter_medium_status()` function in the `error:` label even when the `status` variable was already set. Solution ======== Add another label to specifically convert status from `enum lttng_live_viewer_status` to `enum ctf_msg_iter_medium_status`. Notes ===== - This commit adds the printing of the value of the unknown status received by the Relay Signed-off-by: Francis Deslauriers Change-Id: I6c740dd28ee0b336cf06dbdbf60d6333cf79d168 Reviewed-on: https://review.lttng.org/c/babeltrace/+/3758 Reviewed-by: Jérémie Galarneau Tested-by: jenkins ---