Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jeremie.galarneau@efficios.com (Jérémie Galarneau)
Subject: [lttng-dev] [PATCH lttng-tools 1/2] Fix relayd: initialize beacon to -1ULL
Date: Thu, 25 Apr 2019 14:26:45 -0400	[thread overview]
Message-ID: <20190425182644.GC4708@gmail.com> (raw)
In-Reply-To: <20190402174117.8663-1-mathieu.desnoyers@efficios.com>

Both patches are merged in master, stable-2.11, stable-2.10, and
stable-2.9.

Thanks!
J?r?mie

On Tue, Apr 02, 2019 at 01:41:16PM -0400, Mathieu Desnoyers wrote:
> 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 at efficios.com>
> ---
>  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 80c8aa0c..1218c2f4 100644
> --- a/src/bin/lttng-relayd/stream.c
> +++ b/src/bin/lttng-relayd/stream.c
> @@ -98,6 +98,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);
> -- 
> 2.17.1
> 


           reply	other threads:[~2019-04-25 18:26 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20190402174117.8663-1-mathieu.desnoyers@efficios.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190425182644.GC4708@gmail.com \
    --to=jeremie.galarneau@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox