Re: -fno-omit-frame-pointer does not work as advertised

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Kevin Kofler via devel:

> Hi,
>
> to those who are pushing the -fno-omit-frame-pointer change: Are you aware 
> that neither that flag nor even -mno-omit-leaf-frame-pointer actually 
> guarantee that every leaf function is going to carry a frame pointer, as 
> required for your backtraces?

Jakub mentioned it.

> See for yourself:
> https://godbolt.org/z/TjzTsWoWT
>
> The only way to get GCC to generate a frame pointer for this function is to 
> not use any optimization at all (-O0, or just leave the flags empty, which 
> unfortunately defaults to -O0 in GCC).

> Another issue is that even if the function does have a frame pointer, it 
> takes time to set up the frame pointer (push rbp; mov rbp, rsp), and it also 
> needs to be popped at the end (pop rbp) before returning (ret), so a 
> randomly sampled snapshot can always happen to be taken in the short time 
> window where the frame pointer is not ready, which will also lead to the 
> caller being unable to be located. This inherently makes purely frame-
> pointer-based unwinding unreliable.

There's also linker-generated code (which should have DWARF frame data
these days) and manually written assembler code (where DWARF data can
be missing, too).  For frame pointers, these specific issues only lead
to skiped frames at the top of the backtrace.  My impression is that
those want to produce flamegraphs are more interested in the lower
regions of the stack, which are not affected by skipped frames.  But
maybe not; we wouldn't need -mno-omit-leaf-frame-pointer in that case.
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux