Bug 10671 – Stack unwinding is insufficient on Linux x86_64. (-fomit-frame-pointer)
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2013-07-19T04:20:32Z
Last change time
2021-02-19T02:59:13Z
Assigned to
No Owner
Creator
Marco Leise
Comments
Comment #0 by Marco.Leise — 2013-07-19T04:20:32Z
Here is the catch:
Druntime's stack unwinding code relies on frame pointers.
Optimized gcc code (at any opt. level > 0) doesn't contain frame pointers.
(Unless the architecture requires it for debugging, like x86 or -fno-omit-frame-pointer is given.)
That means that using any Linux x86-64 libraries that take callbacks into D results in broken exception handling! Unless the maintainers of a specific distribution added -fno-omit-frame-pointer. You cannot expect that on Gentoo for example.
Comment #1 by 4burgos — 2016-10-18T13:47:56Z
I don't think this applies anymore (with dwarf eh.). But the case is on the point here - I'm using old runtime, and with Ubuntu Xenial, once exception handling walks from `main` back to `_libc_start_main` it just terminates.
Comment #2 by pro.mathias.lang — 2021-02-19T02:59:13Z
Not an issue anymore since the switch to DWARF EH (just tested with GDC and LDC).