Fix relayd: initialize beacon to -1ULL
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Apr 2019 16:40:22 +0000 (12:40 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 10 Apr 2019 23:36:37 +0000 (19:36 -0400)
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 <mathieu.desnoyers@efficios.com>
src/bin/lttng-relayd/stream.c

index e467cfa6c44e797ad65c4b741f0f2eea43aebf8c..f989bfd1361be36bd20d4edfa018f36b11de062b 100644 (file)
@@ -97,6 +97,7 @@ struct relay_stream *stream_create(struct ctf_trace *trace,
        stream->tracefile_count = tracefile_count;
        stream->path_name = path_name;
        stream->channel_name = channel_name;
+       stream->beacon_ts_end = -1ULL;
        lttng_ht_node_init_u64(&stream->node, stream->stream_handle);
        pthread_mutex_init(&stream->lock, NULL);
        pthread_mutex_init(&stream->reflock, NULL);
This page took 0.027663 seconds and 5 git commands to generate.