From: Jérémie Galarneau Date: Thu, 29 Mar 2018 19:13:34 +0000 (-0400) Subject: Fix: unhandled prev_seq initial value X-Git-Tag: v2.11.0-rc1~316 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3765c8cc40733ddde776d57c1ece30f2b05beea4;p=lttng-tools.git Fix: unhandled prev_seq initial value The previous sequence number of a stream is initialized to -1ULL and comparing the current sequence number against it to perform a rotation will yield unexepected results. The assumption that the previous sequence number is less than the current one is assert()'ed on elsewhere. This case triggers whenever a rotation is performed before the relay daemon has received a packet for a given stream. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index f68ecdfbc..e3c070f8b 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1722,7 +1722,8 @@ int try_rotate_stream(struct relay_stream *stream) goto end; } - if (stream->prev_seq < stream->rotate_at_seq_num) { + if (stream->prev_seq < stream->rotate_at_seq_num || + stream->prev_seq == -1ULL) { DBG("Stream %" PRIu64 " no yet ready for rotation", stream->stream_handle); goto end;