Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758011AbdCUShz (ORCPT ); Tue, 21 Mar 2017 14:37:55 -0400 Received: from smtprelay0125.hostedemail.com ([216.40.44.125]:55967 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757109AbdCUSgp (ORCPT ); Tue, 21 Mar 2017 14:36:45 -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:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:4250:4321:4362:5007:6261:6299:7875:7903:9040:10004:10226:10400:10848:10967:11026:11232:11658:11914:12043:12109:12296:12438:12555:12663:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21325:21433:21451:30029:30051:30054: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: sock36_325d9b4867115 X-Filterd-Recvd-Size: 1868 Date: Tue, 21 Mar 2017 14:35:43 -0400 From: Steven Rostedt To: John Kacur Cc: lkml Subject: Re: [PATCH] trace-cmd: Fix segmentation fault in trace-snapshot Message-ID: <20170321143543.210ab58a@vmware.local.home> In-Reply-To: <1490112713-9456-1-git-send-email-jkacur@redhat.com> References: <1490112713-9456-1-git-send-email-jkacur@redhat.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; 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 Content-Length: 1047 Lines: 39 On Tue, 21 Mar 2017 17:11:53 +0100 John Kacur wrote: > To reproduce the problem: > > plugin 'wakeup' > trace-cmd: Device or resource busy > Segmentation fault (core dumped) > > When the user triggers a condition such as EBUSY the program should > die gracefully. The problem here is simply caused by an extra > conversion specifier in "die" in the write_file function Thanks John! I'm currently traveling but I'll apply this when I get a chance. -- Steve > > Signed-off-by: John Kacur > --- > trace-snapshot.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/trace-snapshot.c b/trace-snapshot.c > index 9d3608c49563..771b065ccfa4 100644 > --- a/trace-snapshot.c > +++ b/trace-snapshot.c > @@ -42,7 +42,8 @@ static void write_file(const char *name, char *val) > > n = write(fd, val, strlen(val)); > if (n < 0) > - die("failed to write '%d' to %s\n", path); > + die("failed to write to %s\n", path); > + > tracecmd_put_tracing_file(path); > close(fd); > }