[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cih+JqmhVOSoYmRUK2+FRWnknQ6VucYpg5ZC01BYqdv=Q@mail.gmail.com>
Date: Fri, 9 Feb 2024 16:21:51 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Tom Rix <trix@...hat.com>,
Ravi Bangoria <ravi.bangoria@....com>, James Clark <james.clark@....com>,
Kan Liang <kan.liang@...ux.intel.com>, John Garry <john.g.garry@...cle.com>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH v2 8/9] perf srcline: Add missed addr2line closes
On Wed, Jan 31, 2024 at 4:15 PM Ian Rogers <irogers@...gle.com> wrote:
>
> The child_process for addr2line sets in and out to -1 so that pipes
> get created. It is the caller's responsibility to close the pipes,
> finish_command doesn't do it. Add the missed closes.
>
> Fixes: b3801e791231 ("perf srcline: Simplify addr2line subprocess")
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> tools/perf/util/srcline.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
> index 034b496df297..7addc34afcf5 100644
> --- a/tools/perf/util/srcline.c
> +++ b/tools/perf/util/srcline.c
> @@ -399,6 +399,8 @@ static void addr2line_subprocess_cleanup(struct child_process *a2l)
> kill(a2l->pid, SIGKILL);
> finish_command(a2l); /* ignore result, we don't care */
> a2l->pid = -1;
> + close(a2l->in);
> + close(a2l->out);
I was about to ask the stderr, but addr2line_subprocess_init()
sets a2l->no_stderr already.
I wish it could be handled in finish_command() but it seems
the API allows setting external file descriptors (before calling
start_command). Hmm..
Anyway it looks like an independent fix.
Thanks,
Namhyung
> }
>
> free(a2l);
> --
> 2.43.0.429.g432eaa2c6b-goog
>
Powered by blists - more mailing lists