From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751824AbcGOT0i (ORCPT ); Fri, 15 Jul 2016 15:26:38 -0400 Received: from smtprelay0050.hostedemail.com ([216.40.44.50]:36421 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751556AbcGOT0h (ORCPT ); Fri, 15 Jul 2016 15:26:37 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:355:379:541:599:800:960:973:981:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:4250:5007:6119:6261:7875:7903:9040:10004:10400:10848:10967:11232:11658:11914:12296:12517:12519:12740:13069:13311:13357:13439:14096:14097:14181:14659:14721:21080:30054:30062:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: sail17_73aff6c5df30c X-Filterd-Recvd-Size: 2027 Date: Fri, 15 Jul 2016 15:26:33 -0400 From: Steven Rostedt To: John Kacur Cc: Daniel Bristot de Oliveira , LKML Subject: Re: [PATCH] trace-cmd: record crashes if -f is used before -e event. Message-ID: <20160715152633.249ab195@gandalf.local.home> In-Reply-To: References: <894eb6c8a5665fba64811395e0d1204e201f4992.1437414265.git.bristot@redhat.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Nov 2015 00:57:14 +0100 (CET) John Kacur wrote: > On Mon, 20 Jul 2015, Daniel Bristot de Oliveira wrote: > > > The trace-cmd record command is crashing if a -f filter is used before > > a -e event. > > > > The usage a -f before a -e is a command line error, and trace-cmd > > record detects this error by checking if the last_event pointer is NULL. > > > > However, the last_event is not initialized as NULL and this command line > > error is not detected. Then, the last_event is used to save the filter > > options and this causes a segmentation fault because last_event was not > > initialized yet. > > > > This problem is fixed by initializing last_event as NULL. > > > > How-to reproduce: > > # trace-cmd record -f foo > > Segmentation fault > > > > Expected output: > > # trace-cmd record -f foo > > filter must come after event > > > > Signed-off-by: Daniel Bristot de Oliveira > Tested-by: John Kacur > > Works well, please apply Applied. Thanks! -- Steve