linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ivan Babrou <ivan@cloudflare.com>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@cloudflare.com, Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	James Clark <james.clark@arm.com>,
	Ian Rogers <irogers@google.com>,
	Fangrui Song <maskray@google.com>
Subject: Re: [PATCH] perf unwind: fix unitialized offset on aarch64
Date: Sat, 2 Jul 2022 09:18:38 -0300	[thread overview]
Message-ID: <YsA3nmwXyLfN4OQA@kernel.org> (raw)
In-Reply-To: <20220701182046.12589-1-ivan@cloudflare.com>

Em Fri, Jul 01, 2022 at 11:20:46AM -0700, Ivan Babrou escreveu:
> Commit dc2cf4ca866f uncovered the following issue on aarch64:
> 
>     util/unwind-libunwind-local.c: In function 'find_proc_info':
>     util/unwind-libunwind-local.c:386:28: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>     386 |                         if (ofs > 0) {
>         |                            ^
>     util/unwind-libunwind-local.c:199:22: note: 'offset' was declared here
>     199 |         u64 address, offset;
>         |                      ^~~~~~
>     util/unwind-libunwind-local.c:371:20: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>     371 |                 if (ofs <= 0) {
>         |                    ^
>     util/unwind-libunwind-local.c:199:22: note: 'offset' was declared here
>     199 |         u64 address, offset;
>         |                      ^~~~~~
>     util/unwind-libunwind-local.c:363:20: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>     363 |                 if (ofs <= 0) {
>         |                    ^
>     util/unwind-libunwind-local.c:199:22: note: 'offset' was declared here
>     199 |         u64 address, offset;
>         |                      ^~~~~~
>     In file included from util/libunwind/arm64.c:37:

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Ivan Babrou <ivan@cloudflare.com>
> Fixes: dc2cf4ca866f
> ---
>  tools/perf/util/unwind-libunwind-local.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
> index 37622699c91a..eaa8fa4b34f3 100644
> --- a/tools/perf/util/unwind-libunwind-local.c
> +++ b/tools/perf/util/unwind-libunwind-local.c
> @@ -197,7 +197,7 @@ static int elf_section_address_and_offset(int fd, const char *name, u64 *address
>  #ifndef NO_LIBUNWIND_DEBUG_FRAME
>  static u64 elf_section_offset(int fd, const char *name)
>  {
> -	u64 address, offset;
> +	u64 address, offset = 0;
>  
>  	if (elf_section_address_and_offset(fd, name, &address, &offset))
>  		return 0;
> -- 
> 2.36.1

-- 

- Arnaldo

      reply	other threads:[~2022-07-02 12:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 18:20 [PATCH] perf unwind: fix unitialized offset on aarch64 Ivan Babrou
2022-07-02 12:18 ` Arnaldo Carvalho de Melo [this message]

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=YsA3nmwXyLfN4OQA@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=ivan@cloudflare.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@cloudflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maskray@google.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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).