All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: James Clark <james.clark@linaro.org>
Cc: David <davidzgumberg@gmail.com>,
	linux-perf-users@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: perf: Live mode flamegraph recording results in segmentation fault
Date: Mon, 10 Mar 2025 14:30:23 -0700	[thread overview]
Message-ID: <Z89Z7zvqbKmc82gA@google.com> (raw)
In-Reply-To: <516dd4bb-c317-42ce-b539-92c6c1eabcbe@linaro.org>

On Mon, Mar 10, 2025 at 11:53:06AM +0000, James Clark wrote:
> 
> 
> On 07/03/2025 4:25 pm, David wrote:
> > I've reproduced this on recent versions of Debian, Ubuntu, CentOS, and
> > Fedora,
> > and I used to be able to downgrade perf and it would work, but an early
> > enough
> > version of perf is no longer available from most package repositories.
> > 
> > Steps I have taken to reproduce:
> > 
> > 1. Install perf from a distro package manager. ( `sudo dnf install perf`)
> > 
> > ```
> >   $ perf --version
> > 
> > perf version 6.13.5-200.fc41.x86_64)
> > ```
> > 
> > 2. Attempt a live flamegraph report:
> > 
> > ```
> > 
> > $ perf script flamegraph ls
> > /usr/libexec/perf-core/scripts/python/bin/flamegraph-report: line 3:
> > 1644 Segmentation fault      (core dumped) perf script -s
> > "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@"
> > ```
> > 
> > 
> 
> Hi David,
> 
> Are you able to bisect this to find the breaking commit?
> 
> Is this the full output you get? I'm not able to reproduce your exact issue.
> I do see a bug with the template download prompt but it produces more output
> than you have:
> 
>  $ perf script flamegraph ls
> 
>   Warning: Flame Graph template '/usr/share/d3-flame-graph/d3-
>   flamegraph-base.html' does not exist.
>   [...]
>   s = input("Do you wish to download a template from cdn.jsdelivr.net?
>   (this warning can be suppressed with --allow-download) [yn] ").lower()
>   OSError: [Errno 9] Bad file descriptor
>   Fatal Python error: handler_call_die: problem in Python trace event
>   handler
>   Python runtime state: initialized
> 
>   Current thread 0x00007d1916afd400 (most recent call first):
>   <no Python frame>
> 
>   Extension modules: apt_pkg (total: 1)
>   Aborted (core dumped)
> 
> But if I avoid the record/report wrapper and go straight to the script it
> works:
> 
>   $ perf record -g ls
>   $ perf script flamegraph.py
> 
>   [...]
>   Do you wish to download a template from cdn.jsdelivr.net? (this
>   warning can be suppressed with --allow-download) [yn] y
> 
>   dumping data to flamegraph.html
> 
> I'm wondering if the template prompt ever worked in conjunction with the
> wrappers? Maybe they were only tested with the template already installed,
> or the script was always used directly when the need for a template was
> added.

I don't know but it didn't work well for me too.  Maybe it should have
default 'y' for live mode.

Thanks,
Namhyung


  reply	other threads:[~2025-03-10 21:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 16:25 perf: Live mode flamegraph recording results in segmentation fault David
2025-03-10 11:53 ` James Clark
2025-03-10 21:30   ` Namhyung Kim [this message]
2025-03-11 10:23     ` James Clark

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=Z89Z7zvqbKmc82gA@google.com \
    --to=namhyung@kernel.org \
    --cc=davidzgumberg@gmail.com \
    --cc=james.clark@linaro.org \
    --cc=linux-perf-users@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.