Re: [PATCH] perf annotate: Fix crashes on empty annotate windows

From: Arnaldo Carvalho de Melo

Date: Thu Jun 04 2026 - 10:38:40 EST


On Tue, Apr 21, 2026 at 07:15:45PM -0700, Namhyung Kim wrote:
> On Mon, Apr 20, 2026 at 12:52:17PM +0100, James Clark wrote:
> > Annotate can open with an empty window if the disassembly tool fails.
> > After the linked change, the TUI started assuming there was a current
> > annotation line and could assert or segfault in the seek, refresh, and
> > source-toggle paths.
> >
> > Handle empty annotate windows explicitly: set the asm entry count before
> > resetting the browser, return early when refreshing an empty list, and
> > ignore source line toggle when there is no current annotation line.
> >
> > Fixes the following when opening an annotation:
> >
> > perf: ui/browser.c:125: ui_browser__list_head_seek: Assertion `pos != NULL' failed.
> > Aborted
> >
> > Fixes: e201757f7a0a ("perf annotate: Fix source code annotate with objdump")
> > Assisted-by: GitHub Copilot:GPT-5.4
> > Signed-off-by: James Clark <james.clark@xxxxxxxxxx>
>
> Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Thanks, applied to perf-tools-next, for v7.2.

- Arnaldo