TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ubuntu 24.04 LTS will enable frame pointers by default

222 pointsby jnsgrukover 1 year ago

17 comments

stephendauseover 1 year ago
For anyone else who didn&#x27;t know what a frame pointer was: <a href="https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;194339&#x2F;frame-pointer-explanation" rel="nofollow noreferrer">https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;1943...</a>
评论 #38633297 未加载
ghotliover 1 year ago
I somewhat painstakingly figured this out the hard way pulling core dumps off of embedded linux devices that gdb had a hard time working with. At the time I was like whew why is omitting frame pointers the default at all in so many places when it didn&#x27;t seem to make a measurable difference in the performance of the software. I guess it&#x27;s just vestigial these days and yes please use a compiler flag like this when it measurably makes sense. Making debugging simpler for the rest of us is the way to go.
评论 #38633336 未加载
评论 #38633955 未加载
branczover 1 year ago
Frame pointers are such a destructive micro-optimization to omit by default, I am beyond excited about this collaboration with the folks at Canonical to make Ubuntu debuggable by default!
评论 #38631117 未加载
评论 #38634296 未加载
评论 #38640537 未加载
评论 #38634205 未加载
londons_exploreover 1 year ago
So the whole world should take a 1-2% performance penalty on everything so some users can maybe run a profiler?<p>Wouldn&#x27;t it make more sense to just have an &#x27;apt reinstall all --with-frame-pointers&#x27; command that power users could run before they wanted to profile something?
评论 #38635701 未加载
评论 #38635012 未加载
评论 #38635225 未加载
评论 #38634778 未加载
评论 #38634577 未加载
评论 #38634581 未加载
评论 #38640546 未加载
评论 #38636627 未加载
评论 #38634808 未加载
zX41ZdbWover 1 year ago
ClickHouse has always-on profiling without frame pointers. But the implementation is very hard - it required patching of LLVM&#x27;s libunwind to make it 100% async-signal safe. Using frame pointers should be easier and faster.
pryzover 1 year ago
The post from Polar Signal blog <a href="https:&#x2F;&#x2F;www.polarsignals.com&#x2F;blog&#x2F;posts&#x2F;2023&#x2F;12&#x2F;13&#x2F;embracing-frame-pointers-in-ubuntu-24-04-lts" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.polarsignals.com&#x2F;blog&#x2F;posts&#x2F;2023&#x2F;12&#x2F;13&#x2F;embracing...</a><p>Exciting!
kapilvtover 1 year ago
hmm.. I wonder if the 10% performance regression in python has been resolved. <a href="https:&#x2F;&#x2F;discuss.python.org&#x2F;t&#x2F;python-3-11-performance-with-frame-pointers&#x2F;22507" rel="nofollow noreferrer">https:&#x2F;&#x2F;discuss.python.org&#x2F;t&#x2F;python-3-11-performance-with-fr...</a>
评论 #38632145 未加载
amneover 1 year ago
Even in context it is hard to understand this: &quot;The performance wins that these can provide far outweigh the comparatively tiny loss in performance.&quot;<p>My guess is that on average the potential performance discovered with the techniques this enables is higher than the guaranteed negligible performance loss.
评论 #38633360 未加载
评论 #38632196 未加载
daoistmonkover 1 year ago
hasn&#x27;t this already been in fedora for almost a year?
评论 #38631354 未加载
评论 #38632619 未加载
评论 #38633596 未加载
评论 #38631726 未加载
herodoturtleover 1 year ago
For the layman, what does this mean?
评论 #38632561 未加载
评论 #38632260 未加载
评论 #38632329 未加载
评论 #38633701 未加载
评论 #38632209 未加载
评论 #38632065 未加载
dmpk2kover 1 year ago
Thank god. AMD making the base pointer optional in the x86-64 ABI was foolish.
AndyKelleyover 1 year ago
Why not let the upstream application developer decide, rather than choosing for them?<p>This is one of the downsides of using C&#x2F;C++ rather than a modern programming language like Rust or Zig. In the former case, the system maintainers reach across the table and change the settings, despite what the actual application developer has chosen. In the latter, the upstream developers&#x27; choices are respected more, mainly because the tooling is less standardized.<p>Shoutouts to this NixOS bug which is still ongoing after causing much pain for many years: <a href="https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;issues&#x2F;18995">https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;issues&#x2F;18995</a>
评论 #38636800 未加载
m463over 1 year ago
interesting article on frame pointer optimization:<p><a href="https:&#x2F;&#x2F;community.ibm.com&#x2F;community&#x2F;user&#x2F;wasdevops&#x2F;blogs&#x2F;kevin-grigorenko1&#x2F;2023&#x2F;02&#x2F;21&#x2F;lessons-from-the-field-26-frame-pointers-and-why-t" rel="nofollow noreferrer">https:&#x2F;&#x2F;community.ibm.com&#x2F;community&#x2F;user&#x2F;wasdevops&#x2F;blogs&#x2F;kev...</a>
brenns10over 1 year ago
This is a good idea for the short-term. As of now, frame pointers are the most reliable way to ensure that software can be profiled by tools like perf*. The core issue is that the kernel must be the one to unwind the userspace stack, and it only knows how to unwind stacks with frame pointers**. The .eh_frame data will never be supported by the kernel, because it involves a turing-complete program that must be executed to compute the necessary unwind info***.<p>For the long term, the more exciting option that&#x27;s emerging is SFrame[1]. This is a new data section which would be generated by the compiler and contains unwind tables which the kernel will be able to understand. Unlike DWARF&#x2F;.eh_frame, these tables would remain in the final binary (i.e. not be stripped away), and on exec(), the kernel would store them for use during profiling. Since the format is quite similar to ORC(*), and Steven Rostedt is quite invested in the format, it seems a safe bet that support will land in the kernel.<p>My hope isn&#x27;t necessarily that a distribution completely disables frame pointers once this format becomes available... though it could be an interesting thing to try. Rather, there can be a conscious choice about whether frame pointers are used, or SFrame, which would be useful for cases like Python, where it&#x27;s mentioned that frame pointers may still have a significant performance impact. The kernel should be able to fall back to frame pointers when SFrame is unavailable, which means that either will be acceptable. Ideally, in a few years time we&#x27;ll be able to go back to forgetting about frame pointers for most cases :)<p>---<p>* Ironically, the kernel itself tends not to use frame pointers! It has its own unwind format called ORC, which gets generated by an in-kernel program called &quot;objtool&quot; which essentially reverse engineers the assembly generated by the compiler. It&#x27;s x86_64-specific and frequently needs adjustment when the compiler changes code generation. It can&#x27;t be used for userspace programs.<p>** it also knows how to unwind kernel stacks with ORC (see above)<p>*** There is an option to allow perf to unwind with DWARF, but it&#x27;s a total hack (though a very effective one). By passing --call-graph=dwarf, you can instruct the kernel to copy the userspace stack (by default, 8k bytes!) into the perf event buffer with each sample (this can be as many as 100 or 1000 samples per second, per CPU...). Later, the perf userspace program will use that info, along with information about each process&#x27;s address space, and the debuginfo for each program, to unwind the stacks. This has huge performance overhead, and it requires that you have easy access to debuginfo, which may not be the case, especially for container workloads.<p>[1] <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;940686&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;940686&#x2F;</a>
评论 #38634387 未加载
ur-whaleover 1 year ago
What about binary size increase ?
therealmarvover 1 year ago
Pro tip for performance optimisation in Ubuntu (you also gain more RAM):<p>Remove snap (or choose a Ubuntu distro variant like Pop OS without snap)
评论 #38632550 未加载
评论 #38632839 未加载
westurnerover 1 year ago
Call stack &gt; Structure &gt; Stack and <i>Frame pointers</i>: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Call_stack#Stack_and_frame_pointers" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Call_stack#Stack_and_frame_poi...</a><p>What do the Coding Guidelines listed in e.g. awesome-safety-critical say about Frame pointers? <a href="https:&#x2F;&#x2F;awesome-safety-critical.readthedocs.io&#x2F;en&#x2F;latest&#x2F;#coding-guidelines" rel="nofollow noreferrer">https:&#x2F;&#x2F;awesome-safety-critical.readthedocs.io&#x2F;en&#x2F;latest&#x2F;#co...</a><p>(Edit)<p>&#x2F;? &quot;cert&quot; &quot;frame pointer&quot; <a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=%22cert%22+%22frame+pointer%22" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=%22cert%22+%22frame+pointer%...</a> :<p>- Stack buffer overflow &gt; Exploiting stack buffer overflows: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Stack_buffer_overflow" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Stack_buffer_overflow</a> :<p>&gt; <i>In figure C above, when an argument larger than 11 bytes is supplied on the command line foo() overwrites local stack data, the saved</i> frame pointer, <i>and most importantly, the return address</i><p>What about the Top 25?<p>&#x2F;? site:cwe.mitre.org &quot;frame pointer&quot; <a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=site%3Acwe.mitre.org+%22frame+pointer%22" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=site%3Acwe.mitre.org+%22fram...</a> :<p>- CWE-121: Stack-based Buffer Overflow <a href="https:&#x2F;&#x2F;cwe.mitre.org&#x2F;data&#x2F;definitions&#x2F;121.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;cwe.mitre.org&#x2F;data&#x2F;definitions&#x2F;121.html</a><p>This is closer to a better approach for security, debuggability, and performance IMHO:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38138010">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38138010</a> :<p>&gt; <i>gdb on Fedora auto-installs signed debuginfo packages with debug symbols; Fedora hosts a debuginfod server for their packages (which are built by Koji) and sets `DEBUGINFOD_URLS=`</i><p>&gt; <i>Without debug symbols, a debugger has to read unlabeled ASM instructions (or VM opcodes (or an LL IR)).</i>
评论 #38636033 未加载