* [PATCH] trace-cmd: Fix segmentation fault in trace-snapshot
@ 2017-03-21 16:11 John Kacur
2017-03-21 18:35 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: John Kacur @ 2017-03-21 16:11 UTC (permalink / raw)
To: Steven Rostedt, lkml; +Cc: John Kacur
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
Signed-off-by: John Kacur <jkacur@redhat.com>
---
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);
}
--
2.5.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] trace-cmd: Fix segmentation fault in trace-snapshot
2017-03-21 16:11 [PATCH] trace-cmd: Fix segmentation fault in trace-snapshot John Kacur
@ 2017-03-21 18:35 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2017-03-21 18:35 UTC (permalink / raw)
To: John Kacur; +Cc: lkml
On Tue, 21 Mar 2017 17:11:53 +0100
John Kacur <jkacur@redhat.com> 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 <jkacur@redhat.com>
> ---
> 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);
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-21 18:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 16:11 [PATCH] trace-cmd: Fix segmentation fault in trace-snapshot John Kacur
2017-03-21 18:35 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®