From: Steven Rostedt <rostedt@goodmis.org>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] trace-cmd: Fix trace-cmd report crash while displaying trace.dat in specific use case
Date: Mon, 4 May 2020 16:00:09 -0400 [thread overview]
Message-ID: <20200504160009.2223160a@gandalf.local.home> (raw)
In-Reply-To: <20200504062711.107867-2-tz.stoyanov@gmail.com>
On Mon, 4 May 2020 09:27:08 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
> The trace-cmd report command crashes while displaying a file recorded with "--proc-map" and "-B" options:
> #trace-cmd record --proc-map -B test -e sched -F sleep 1
> The "--proc-map" options saves the address map of "sleep" into the trace.dat file. This
> information is used by KernelShark. The "-B" options traces the specified events into a
> ftrace instance "test".
> When such file is opened using libtracecmd APIs, the proc-map is parsed and saved into
> a tracecmd_input handler, as linked list "pid_maps". Later, when the ftrace instance
> "test" is parsed, a copy of this handler is used to fill it with the instance's trace data.
> Both tracecmd_input handlers share the same "pid_maps" list, thus leads to a double
> free of the list, when handlers are destroyed.
> As this "pid_maps" is not used in ftrace buffers, the "pid_maps" list of the copy can be
> initialized to NULL.
>
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
FYI, I changed the subject and body to this:
trace-cmd: Fix trace-cmd report crash while displaying trace.dat with --proc-map and -B options
The trace-cmd report command crashes while displaying a file recorded with
"--proc-map" and "-B" options:
# trace-cmd record --proc-map -B test -e sched -F sleep 1
The "--proc-map" options saves the address map of "sleep" into the trace.dat
file. This information is used by KernelShark. The "-B" option traces the
specified events into a ftrace instance "test".
When such a file is opened using libtracecmd APIs, the proc-map is parsed and
saved into a tracecmd_input handler, as linked list "pid_maps". Later, when
the ftrace instance "test" is parsed, a copy of this handler is used to fill
it with the instance's trace data. Both tracecmd_input handlers share the
same "pid_maps" list, thus leads to a double free of the list when the
handlers are destroyed. As this "pid_maps" is not used in ftrace buffers,
the "pid_maps" list of the copy can be initialized to NULL.
-- Steve
next prev parent reply other threads:[~2020-05-04 20:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 6:27 [PATCH v2 0/4] Few small trace-cmd fixes Tzvetomir Stoyanov (VMware)
2020-05-04 6:27 ` [PATCH v2 1/4] trace-cmd: Fix trace-cmd report crash while displaying trace.dat in specific use case Tzvetomir Stoyanov (VMware)
2020-05-04 20:00 ` Steven Rostedt [this message]
2020-05-04 6:27 ` [PATCH v2 2/4] trace-cmd: Add "main" in the output of trace-cmd stat when displaying main instance Tzvetomir Stoyanov (VMware)
2020-05-04 13:41 ` Steven Rostedt
2020-05-04 6:27 ` [PATCH v2 3/4] trace-cmd: Create ftrace instances before using them Tzvetomir Stoyanov (VMware)
2020-05-04 6:27 ` [PATCH v2 4/4] trace-cmd: Do not try to update parent's memory from a fork()-ed child Tzvetomir Stoyanov (VMware)
2020-05-04 20:30 ` Steven Rostedt
2020-05-05 8:39 ` Tzvetomir Stoyanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200504160009.2223160a@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tz.stoyanov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).