Re: [PATCH v2] perf annotate: Use jump__delete when freeing LoongArch jumps

From: Namhyung Kim

Date: Tue Apr 14 2026 - 13:13:14 EST


On Mon, 13 Apr 2026 18:03:55 +0800, Rong Bao wrote:
> Currently, the initialization of loongarch_jump_ops does not contain an
> assignment to its .free field. This causes disasm_line__free() to fall
> through to ins_ops__delete() for LoongArch jump instructions.
>
> ins_ops__delete() will free ins_operands.source.raw and
> ins_operands.source.name, and these fields overlaps with
> ins_operands.jump.raw_comment and ins_operands.jump.raw_func_start.
> Since in loongarch_jump__parse(), these two fields are populated by
> strchr()-ing the same buffer, trying to free them will lead to undefined
> behavior.
>
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung