Fix: src.ctf.lttng-live: overwrite of error status trips `BT_ASSERT()`
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 13 Jul 2020 17:43:59 +0000 (13:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Jul 2020 20:39:36 +0000 (16:39 -0400)
commit535fb48a33f404e13d8ec0c9d291b4e00d6b40c6
tree1b9f2c88294424b97707ce433918cf396d469f4c
parent6488b1761f590b751acbdef8f5918f97ac52bc4b
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 <francis.deslauriers@efficios.com>
Change-Id: I6c740dd28ee0b336cf06dbdbf60d6333cf79d168
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3758
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/lttng-live/viewer-connection.c
This page took 0.024179 seconds and 4 git commands to generate.