From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 124C6C433EF for ; Fri, 4 Feb 2022 17:49:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377077AbiBDRtG (ORCPT ); Fri, 4 Feb 2022 12:49:06 -0500 Received: from gateway20.websitewelcome.com ([192.185.61.9]:16666 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241900AbiBDRtG (ORCPT ); Fri, 4 Feb 2022 12:49:06 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 00BA3400D676E for ; Fri, 4 Feb 2022 11:49:06 -0600 (CST) Received: from gator4132.hostgator.com ([192.185.4.144]) by cmsmtp with SMTP id G2fpnx2gpb6UBG2fpngksO; Fri, 04 Feb 2022 11:47:05 -0600 X-Authority-Reason: nr=8 Received: from host-79-47-126-144.retail.telecomitalia.it ([79.47.126.144]:51660 helo=[10.0.1.2]) by gator4132.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nG2fp-0022hu-7t; Fri, 04 Feb 2022 11:47:05 -0600 Message-ID: <23e7889f-9bb4-f607-630f-6f8f0ef90d3d@kernel.org> Date: Fri, 4 Feb 2022 18:46:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 4/4] rtla/osnoise: Fix segmentation fault when failing to enable -t Content-Language: en-US To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org References: <264ff7941b7551ec0b6e5862e40cf3dd593d0ff0.1643990447.git.bristot@kernel.org> <20220204124426.54d82ce2@gandalf.local.home> From: Daniel Bristot de Oliveira In-Reply-To: <20220204124426.54d82ce2@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4132.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - kernel.org X-BWhitelist: no X-Source-IP: 79.47.126.144 X-Source-L: No X-Exim-ID: 1nG2fp-0022hu-7t X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: host-79-47-126-144.retail.telecomitalia.it ([10.0.1.2]) [79.47.126.144]:51660 X-Source-Auth: kernel@bristot.me X-Email-Count: 1 X-Source-Cap: YnJpc3RvdG1lO2JyaXN0b3RtZTtnYXRvcjQxMzIuaG9zdGdhdG9yLmNvbQ== X-Local-Domain: no Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org On 2/4/22 18:44, Steven Rostedt wrote: > On Fri, 4 Feb 2022 17:24:05 +0100 > Daniel Bristot de Oliveira wrote: > >> --- a/tools/tracing/rtla/src/osnoise.c >> +++ b/tools/tracing/rtla/src/osnoise.c >> @@ -750,6 +750,9 @@ void osnoise_put_context(struct osnoise_context *context) >> */ >> void osnoise_destroy_tool(struct osnoise_tool *top) >> { >> + if (!top) >> + return; >> + >> trace_instance_destroy(&top->trace); >> >> if (top->context) > Um, don't you still need to initialize everything to NULL? > > i.e. > > nt osnoise_top_main(int argc, char **argv) > { > struct osnoise_top_params *params; > struct trace_instance *trace; > struct osnoise_tool *record; > struct osnoise_tool *tool; > int return_value = 1; > int retval; > > > > Does not guarantee that record and tool will be initialized to NULL. Aaarrrg, you're right. As this is not related to the other patches, could you just ignore this one, so I can re-send alone? -- Daniel