From 2f9c3030a1c6ba4c1e703a6fbb6d1ef3dd2da8b5 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 24 Apr 2019 18:56:05 -0400 Subject: [PATCH] Fix relayd: initialize beacon to -1ULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The relayd stream beacon_ts_end field is expected to have the value -1ULL when unset (no beacon has been received since last index). However, the initial state is wrong. It is left at the value 0, which indicates that a live beacon has indeed been received (which is untrue), which in turn causes a live beacon with ctf_stream_id of -1ULL to be sent to babeltrace, which does not expect it, and fails. This issue can be triggered with the following scenario: 1) create live session 2) setup UST per-uid buffers tracing 3) start tracing, without any active traced application 4) hook with babeltrace live client to view the trace 5) run a traced application Step 5) will cause the babeltrace live client to receive a stream_id of -1ULL, and error out. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-relayd/stream.c b/src/bin/lttng-relayd/stream.c index 41d44a585..4716f9d79 100644 --- a/src/bin/lttng-relayd/stream.c +++ b/src/bin/lttng-relayd/stream.c @@ -92,6 +92,7 @@ struct relay_stream *stream_create(struct ctf_trace *trace, stream->prev_path_name = NULL; stream->channel_name = channel_name; stream->rotate_at_seq_num = -1ULL; + stream->beacon_ts_end = -1ULL; lttng_ht_node_init_u64(&stream->node, stream->stream_handle); pthread_mutex_init(&stream->lock, NULL); urcu_ref_init(&stream->ref); -- 2.34.1