From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jguoI4DilGL6PgkAWB0awg (envelope-from ) for ; Mon, 30 May 2022 11:28:00 -0400 Received: by simark.ca (Postfix, from userid 112) id 7D1DF1E221; Mon, 30 May 2022 11:28:00 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=UWz8h3mL; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3FA0B1E01D for ; Mon, 30 May 2022 11:27:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1653924478; bh=Bjz4tKmntkUyvIGA0XOh1eiyvg6OOjo9WCxZNuGeZ/w=; h=Date:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=UWz8h3mLUIYwVqHORI/dJ//Eguc46s0Hq+yVeQhANw5BRPDIDw51b4NKdWJsW2GN7 yhYksCfoVVUMSCDgvlN5JJ8eWrh00hy3A0FlQZ+5nedrAbxKgyUiFzcDUoYvvzyb1C D0YcEOmq5e+n4uY7OT/6JlZHARvRLGb0dZv4mB6aBI0BiZhqRFJf6YmnUHUaiwu7Ij 5DtO5GabWFUn91vsVNSQDMmvv48kUwZqkwp+4ikRBnzSAdgcUN5BHEmHcjkHqM3NoK 4vLfX/UYJJAb7eQrKGTcJlmmP8rQ7DSEYO6azB+Iw73n5Cm78mm/qKZi9SkTjotX8N BQ/x5PmKCjplw== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4LBfRy4Vckz3Qt; Mon, 30 May 2022 11:27:58 -0400 (EDT) Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by lists.lttng.org (Postfix) with ESMTPS id 4LBfRx2flRz3TC for ; Mon, 30 May 2022 11:27:57 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id D38B5407DAF for ; Mon, 30 May 2022 11:27:56 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Zim2MKUieYu0; Mon, 30 May 2022 11:27:55 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 9B008407BC1; Mon, 30 May 2022 11:27:55 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 9B008407BC1 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id InWuHw648TNT; Mon, 30 May 2022 11:27:55 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 919994078E2; Mon, 30 May 2022 11:27:55 -0400 (EDT) Date: Mon, 30 May 2022 11:27:55 -0400 (EDT) To: Marcel Hamer Cc: lttng-dev Message-ID: <769020238.11656.1653924475516.JavaMail.zimbra@efficios.com> In-Reply-To: <20220530141021.267219-1-marcel.hamer@windriver.com> References: <20220530141021.267219-1-marcel.hamer@windriver.com> MIME-Version: 1.0 X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4272 (ZimbraWebClient - GC99 (Linux)/8.8.15_GA_4257) Thread-Topic: cleanup stream on snapshot failure Thread-Index: vyS7QYvZSGFE1SA/v9aGIY+NbOlZKA== Subject: Re: [lttng-dev] [PATCH lttng-tools] Fix: cleanup stream on snapshot failure X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jonathan Rajotte-Julien via lttng-dev Reply-To: Jonathan Rajotte-Julien Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" Hi Marcel, Thanks for sending this patch. Looks sensible to me, still do you have a reproducer for it? I went back to bug 1352 and even with https://bugs.lttng.org/attachments/546 was unable to force the assert failure. Cheers ----- Original Message ----- > From: "Marcel Hamer via lttng-dev" > To: "lttng-dev" > Sent: Monday, 30 May, 2022 10:10:21 > Subject: [lttng-dev] [PATCH lttng-tools] Fix: cleanup stream on snapshot failure > When a channel snapshot creation fails the stream should be cleaned up > properly. If the stream is not closed and cleaned properly on a failure, > the next time a snapshot is created an assert is triggered for: > > assert(!stream->trace_chunk); > > inside the snapshot_channel function. Since the stream->trace_chunk was > not reset to NULL. The reset to NULL happens inside the > consumer_stream_close function. > > Fixes #1352 > > Signed-off-by: Marcel Hamer > --- > src/common/ust-consumer/ust-consumer.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/common/ust-consumer/ust-consumer.c > b/src/common/ust-consumer/ust-consumer.c > index f176ca40a..f43216829 100644 > --- a/src/common/ust-consumer/ust-consumer.c > +++ b/src/common/ust-consumer/ust-consumer.c > @@ -1147,13 +1147,13 @@ static int snapshot_channel(struct > lttng_consumer_channel *channel, > if (use_relayd) { > ret = consumer_send_relayd_stream(stream, path); > if (ret < 0) { > - goto error_unlock; > + goto error_close_stream; > } > } else { > ret = consumer_stream_create_output_files(stream, > false); > if (ret < 0) { > - goto error_unlock; > + goto error_close_stream; > } > DBG("UST consumer snapshot stream (%" PRIu64 ")", > stream->key); > @@ -1170,19 +1170,19 @@ static int snapshot_channel(struct > lttng_consumer_channel *channel, > ret = lttng_ustconsumer_take_snapshot(stream); > if (ret < 0) { > ERR("Taking UST snapshot"); > - goto error_unlock; > + goto error_close_stream; > } > > ret = lttng_ustconsumer_get_produced_snapshot(stream, &produced_pos); > if (ret < 0) { > ERR("Produced UST snapshot position"); > - goto error_unlock; > + goto error_close_stream; > } > > ret = lttng_ustconsumer_get_consumed_snapshot(stream, &consumed_pos); > if (ret < 0) { > ERR("Consumerd UST snapshot position"); > - goto error_unlock; > + goto error_close_stream; > } > > /* > -- > 2.25.1 > > _______________________________________________ > lttng-dev mailing list > lttng-dev@lists.lttng.org > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev