]> git.ipfire.org Git - thirdparty/elfutils.git/commit
PR33854: fix regression in dwflst_perf_sample_getframes
authorSerhei Makarov <serhei@serhei.io>
Thu, 29 Jan 2026 17:27:50 +0000 (12:27 -0500)
committerSerhei Makarov <serhei@serhei.io>
Thu, 5 Feb 2026 15:18:55 +0000 (10:18 -0500)
commitbb847768969f39ee44cfc284af0326647610e974
tree31b57b80b63933135ecb048e2312ddca7f6075df
parent19a22a426a076f651f7d1702a577cc8da23e5b7a
PR33854: fix regression in dwflst_perf_sample_getframes

In commit 3ce0d5ed, I missed the fact that
dwflst_perf_sample_getframes needs to handle the case of an unattached
Dwfl, when dwfl->process->ebl is not yet available to translate the
registers. Thus, it can't be a straightforward wrapper of
dwfl_sample_getframes, but should instead handle the attaching logic
identically to that function.

Also fix a leakage of sample_arg in dwflst_sample_getframes that was
happening on attach failure.

* libdwfl_stacktrace (dwflst_sample_getframes): Fix a leak of
  sample_arg on attach failure.
* libdwfl_stacktrace (dwflst_perf_sample_getframes): Implement
  attaching the Dwfl identically to dwflst_sample_getframes.
  Avoid leaking sample_arg on attach failure.

Signed-off-by: Serhei Makarov <serhei@serhei.io>
libdwfl_stacktrace/dwflst_sample_frame.c