D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10671 - Stack unwinding is insufficient on Linux x86_64. (-fomit-frame-pointer)
Summary: Stack unwinding is insufficient on Linux x86_64. (-fomit-frame-pointer)
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-19 04:20 UTC by Marco Leise
Modified: 2021-02-19 02:59 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Marco Leise 2013-07-19 04:20:32 UTC
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 Nemanja Boric 2016-10-18 13:47:56 UTC
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 Mathias LANG 2021-02-19 02:59:13 UTC
Not an issue anymore since the switch to DWARF EH (just tested with GDC and LDC).