linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf check: Add sanitizer feature and use to avoid test failure
Date: Wed, 23 Oct 2024 16:24:49 -0700	[thread overview]
Message-ID: <ZxmFwUPyD34LqAHX@google.com> (raw)
In-Reply-To: <Zxl2etmBtc5XsQ3p@google.com>

On Wed, Oct 23, 2024 at 03:19:38PM -0700, Namhyung Kim wrote:
> On Tue, Oct 22, 2024 at 11:18:18PM -0700, Namhyung Kim wrote:
> > On Tue, Oct 22, 2024 at 10:39:36AM -0700, Ian Rogers wrote:
> > > Sure, the reproduction is trivial, just add -fsanitize=address, so I'm
> > > surprised you're not already seeing it:
> > > ```
> > > $ perf test annotate -v
> > > --- start ---
> > > test child forked, pid 444258
> > >  68e8a0-68e96b l noploop
> > > perf does have symbol 'noploop'
> > > Basic perf annotate test
> > >          : 0      0x68e8a0 <noploop>:
> > >     0.00 :   68e8a0:       pushq   %rbp
> > >     0.00 :   68e8a1:       movq    %rsp, %rbp
> > >     0.00 :   68e8a4:       subq    $0x30, %rsp
> [...]
> > >     0.00 :   92d6:       shrl    %cl, %edx
> > >     0.00 :   92d8:       movl    %edx, %ecx
> > >     0.00 :   92da:       movq    %rax, %rdx
> > > Basic annotate [Failed: missing disasm output when specifying the target symbol]
> > 
> > Hmm.. this is strange.  The error message says it failed when it
> > specified the target symbol (noploop) for perf annotate.
> > 
> > As it's the dominant symbol, it should have the same output for the
> > first function (noploop) whether it has target symbol or not and it
> > should match the disasm_regex.  I'm curious how it can fail here.
> 
> Hmm.. ok.  For some reason, it wasn't failed when I add DEBUG=1.

Oh, now I'm seeing why.  We skip perf_session__delete() on !DEBUG build.
:(

> 
> Without DEBUG, I can see it now.
> 
> =================================================================
> ==1053492==ERROR: LeakSanitizer: detected memory leaks
> 
> Direct leak of 33 byte(s) in 1 object(s) allocated from:
>     #0 0x7f1ad78edd20 in strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:566
>     #1 0x55eda19cb76f in perf_data__open (linux/tools/perf/perf+0x65276f) (BuildId: 6fc1b7cdc123c7bd586ce55ea8b727875f42cda2)
>     #2 0x55eda18ffafa in __perf_session__new (linux/tools/perf/perf+0x586afa) (BuildId: 6fc1b7cdc123c7bd586ce55ea8b727875f42cda2)
>     #3 0x55eda15485d3 in cmd_annotate (linux/tools/perf/perf+0x1cf5d3) (BuildId: 6fc1b7cdc123c7bd586ce55ea8b727875f42cda2)
>     #4 0x55eda1695467 in run_builtin (linux/tools/perf/perf+0x31c467) (BuildId: 6fc1b7cdc123c7bd586ce55ea8b727875f42cda2)
>     #5 0x55eda1695c0e in handle_internal_command (linux/tools/perf/perf+0x31cc0e) (BuildId: 6fc1b7cdc123c7bd586ce55ea8b727875f42cda2)
>     #6 0x55eda153ba72 in main (linux/tools/perf/perf+0x1c2a72) (BuildId: 6fc1b7cdc123c7bd586ce55ea8b727875f42cda2)
>     #7 0x7f1acda43b89 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
> 
> SUMMARY: AddressSanitizer: 33 byte(s) leaked in 1 allocation(s).
> Unexpected signal in test_basic
> 
> No idea how it can leak the data->file.path (that's what I can find
> where strdup is used in the function).

Maybe we need to revisit how much speed up it can give.

Thanks,
Namhyung


  reply	other threads:[~2024-10-23 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  5:56 [PATCH v2] perf check: Add sanitizer feature and use to avoid test failure Ian Rogers
2024-10-22  5:41 ` Namhyung Kim
2024-10-22 17:39   ` Ian Rogers
2024-10-23  6:18     ` Namhyung Kim
2024-10-23 22:19       ` Namhyung Kim
2024-10-23 23:24         ` Namhyung Kim [this message]
2024-10-24  2:42           ` Ian Rogers

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=ZxmFwUPyD34LqAHX@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tmricht@linux.ibm.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).