Linux Perf Users
 help / color / mirror / Atom feed
* USER_REGS inconsistency in the presence of PEBS - current status
@ 2022-07-23 19:36 Markus Stange
  2022-07-25 11:41 ` Milian Wolff
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Stange @ 2022-07-23 19:36 UTC (permalink / raw)
  To: linux-perf-users; +Cc: Milian Wolf

Hi all,

I'd like to follow up to a thread from 2018 titled "PEBS level 2/3
breaks dwarf unwinding! [WAS: Re: Broken dwarf unwinding - wrong stack
pointer register value?]"
https://lore.kernel.org/lkml/6310843.N4ooJGWzKY@agathebauer/T/

In that email thread, it was determined that the kernel will overwrite
the RIP value in the user registers with the "earlier value" from
PEBS, making it inconsistent with the other register values in
USER_REGS and also inconsistent with the USER_STACK memory.
This means that, any time the instruction pointer is near a push/pop
instruction, RIP and RSP are at the risk of being inconsistent with
each other. These inconsistencies break DWARF unwinding.
For example, if RIP points *before* a push instruction, and RSP has
the value *after* that push instruction, and the DWARF unwind rule for
RIP says "The return address is at the top of the stack" but RSP
already reflects the push, then the wrong return address is read.

There was a proposed patch in the referenced thread. Has something
like it been considered for inclusion in the kernel? Has any other
work on this issue happened since the discussion?

I ran into this problem today, with a perf.data file captured on a
system with a 5.15 kernel.

Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-25 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-23 19:36 USER_REGS inconsistency in the presence of PEBS - current status Markus Stange
2022-07-25 11:41 ` Milian Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox