Re: Yet another unwinding approach

2023-01-18 Thread Daniel Colascione
Florian Weimer writes: > * Mark Wielaard: > >> On Wed, 2023-01-18 at 07:22 +0100, Florian Weimer wrote: > >>> If the unwind information is incomplete, this … >>> >>> > 7) signal handler unwinds the calling thread however it wants (and can >>> > sleep and take page faults if needed) >>> >>> … m

Re: Yet another unwinding approach

2023-01-18 Thread Daniel Colascione
Mark Wielaard writes: > Hi Florian, > > On Wed, 2023-01-18 at 07:22 +0100, Florian Weimer wrote: >> * Daniel Colascione: >> >> > See, both pro-FP and anti-FP camps think that it's the kernel that has >> > to do the unwinding unless we copy whole stacks into traces. >> >> Well, I think we shoul

Re: Yet another unwinding approach

2023-01-18 Thread Daniel Colascione
Florian Weimer writes: > * Daniel Colascione: > >> See, both pro-FP and anti-FP camps think that it's the kernel that has >> to do the unwinding unless we copy whole stacks into traces. > > Well, I think we should explore hardware-assisted backtraces (shadow > stacks), which hopefully are going

Re: Yet another unwinding approach

2023-01-18 Thread Mark Wielaard
Hi Florian, On Wed, 2023-01-18 at 15:01 +0100, Florian Weimer wrote: > We won't have unwind data for JIT-compiled code, including libffi > trampolines.  We could stop backtracing there (what does the ABI say > about frames without unwinding information?), but I'm not sure if > that's > going to be

Re: Yet another unwinding approach

2023-01-18 Thread Jakub Jelinek
On Wed, Jan 18, 2023 at 03:01:19PM +0100, Florian Weimer wrote: > > On Wed, 2023-01-18 at 07:22 +0100, Florian Weimer wrote: > > >> If the unwind information is incomplete, this … > >> > >> > 7) signal handler unwinds the calling thread however it wants (and can > >> > sleep and take page faults

Re: Yet another unwinding approach

2023-01-18 Thread Florian Weimer
* Mark Wielaard: > On Wed, 2023-01-18 at 07:22 +0100, Florian Weimer wrote: >> If the unwind information is incomplete, this … >> >> > 7) signal handler unwinds the calling thread however it wants (and can >> > sleep and take page faults if needed) >> >> … might encounter segmentation faults an

Re: Yet another unwinding approach

2023-01-18 Thread Mark Wielaard
Hi Florian, On Wed, 2023-01-18 at 07:22 +0100, Florian Weimer wrote: > * Daniel Colascione: > > > See, both pro-FP and anti-FP camps think that it's the kernel that has > > to do the unwinding unless we copy whole stacks into traces. > > Well, I think we should explore hardware-assisted backtrac

Re: Yet another unwinding approach

2023-01-17 Thread Florian Weimer
* Daniel Colascione: > See, both pro-FP and anti-FP camps think that it's the kernel that has > to do the unwinding unless we copy whole stacks into traces. Well, I think we should explore hardware-assisted backtraces (shadow stacks), which hopefully are going to get merged in Linux 6.2. > Why s

Re: Yet another unwinding approach

2023-01-17 Thread Demi Marie Obenour
On 1/17/23 19:21, Mark Wielaard wrote: > Hi Daniel, > > On Mon, Jan 16, 2023 at 08:30:21PM -, Daniel Colascione wrote: >> As mentioned in [1], instead of finding a way to have the kernel >> unwind user programs, we can create a protocol through which the >> kernel can ask usermode to unwind it

Re: Yet another unwinding approach

2023-01-17 Thread Mark Wielaard
Hi Daniel, On Mon, Jan 16, 2023 at 08:30:21PM -, Daniel Colascione wrote: > As mentioned in [1], instead of finding a way to have the kernel > unwind user programs, we can create a protocol through which the > kernel can ask usermode to unwind itself. I like this idea and was discussing and t

Re: Yet another unwinding approach

2023-01-16 Thread Neal Gompa
On Mon, Jan 16, 2023 at 11:33 PM Daniel Colascione wrote: > > > Having the vDSO do the unwinding allows the unwinding to be entirely > transparent to userspace programs and libraries > > Why *should* unwinding be transparent to userspace programs and libraries? > Userspace can contribute to makin

Re: Yet another unwinding approach

2023-01-16 Thread Daniel Colascione
> Having the vDSO do the unwinding allows the unwinding to be entirely transparent to userspace programs and libraries Why *should* unwinding be transparent to userspace programs and libraries? Userspace can contribute to making unwinding better, especially in the managed case, by hooking into t

Re: Yet another unwinding approach

2023-01-16 Thread Demi Marie Obenour
On 1/16/23 16:32, Daniel Colascione wrote: >> Could the vDSO do the unwinding? > > The vDSO is just userspace code that happens to be provided by the kernel, > so, sure, a function in vDSO *could* unwind. But why would it? What would be > the advantage of doing that over putting the unwinding in

Re: Yet another unwinding approach

2023-01-16 Thread Daniel Colascione
> Could the vDSO do the unwinding? The vDSO is just userspace code that happens to be provided by the kernel, so, sure, a function in vDSO *could* unwind. But why would it? What would be the advantage of doing that over putting the unwinding in libc? To change the vDSO, you have to change the k

Re: Yet another unwinding approach

2023-01-16 Thread Demi Marie Obenour
On 1/16/23 15:54, Daniel Colascione wrote: >> On Mon, Jan 16, 2023 at 3:30 PM Daniel Colascione > wrote: >> >> This sounds great, but how is it going to get made? > Someone has to do it. 😄 I've been thinking about adding this mechanism for a > few years, but haven't had time so far. I suppose the

Re: Yet another unwinding approach

2023-01-16 Thread Daniel Colascione
> On Mon, Jan 16, 2023 at 3:30 PM Daniel Colascione wrote: > > This sounds great, but how is it going to get made? Someone has to do it. :-) I've been thinking about adding this mechanism for a few years, but haven't had time so far. I suppose the first step would be raising the subject on li

Re: Yet another unwinding approach

2023-01-16 Thread Neal Gompa
On Mon, Jan 16, 2023 at 3:30 PM Daniel Colascione wrote: > > Frame pointers also have the disadvantage of working only with AOT-compiled > languages for which a trace analysis tool can associate an instruction > pointer with a semantically-relevant bit of code. If you try to use frame > pointer