Bug 15779 – DWARF EH fails when using stack stomping (-gx)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-03-08T21:54:31Z
Last change time
2021-09-11T23:21:35Z
Keywords
pull
Assigned to
No Owner
Creator
Marenz
Blocks
16407
See also
https://issues.dlang.org/show_bug.cgi?id=21919

Attachments

IDFilenameSummaryContent-TypeSize
1590dwarfeh.tar.gzSmall dub project with dwarfeh errorapplication/gzip567

Comments

Comment #0 by dmdtracker — 2016-03-08T21:54:31Z
Created attachment 1590 Small dub project with dwarfeh error Since I updated to 2.070.2 almost every occasion of an exception thrown causes my program to immediately terminate: dwarfeh(316) fatal error Program exited with code -6 It is very difficult to create a minimized test case, however I managed to give you a small dub project that will exhibit this problem if you run "dub test" in it:
Comment #1 by dmdtracker — 2016-03-08T21:59:12Z
Okay, I managed a minimal test case now: import core.thread; void main() { new Fiber({ throw new Exception("fly"); }).call(); }
Comment #2 by dmdtracker — 2016-03-08T22:00:08Z
I want to add that I am quite annoyed that a bug like this makes it into a release. This cost me at least 2 days of production time.
Comment #3 by dmdtracker — 2016-03-08T22:01:16Z
I forgot: You need to compile with -gx
Comment #4 by dmdtracker — 2016-03-08T23:59:31Z
Und die Moral von der Geschicht, einen Zwerg, den wirft man nicht.
Comment #5 by code — 2016-03-23T08:41:49Z
(In reply to Marenz from comment #4) > Und die Moral von der Geschicht, einen Zwerg, den wirft man nicht. Stack stomping (-gx) is a weird (and complex) feature and apparently wasn't fully tested in combination w/ the new dwarf EH. Note that you shouldn't run any production code w/ -gx.
Comment #6 by bugzilla — 2016-03-24T03:07:41Z
Comment #7 by code — 2016-03-25T18:38:03Z
Quick debugging of this program --- void main() { try { bar(); } catch (Exception e) { } } void bar() { throw new Exception("msg"); } --- reveals that CallSiteRange for bar() is too small (66 instead of 70) and therefor scanLSDA fails. https://github.com/D-Programming-Language/druntime/blob/ff4faa40d88bdd974102105aa17c2851629c8f9a/src/rt/dwarfeh.d#L627
Comment #8 by code — 2016-03-25T20:52:49Z
Comment #9 by github-bugzilla — 2016-03-26T20:47:25Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c388becdb50b78f4201fb1be91813b688ce8bbda fix Issue 15779 - DWARF EH fails when using stack stomping (-gx) https://github.com/D-Programming-Language/dmd/commit/2030b4abbe68d2f8b4b0221f15c9d6e065a2e3af Merge pull request #5579 from MartinNowak/fix15779 fix Issue 15779 - DWARF EH fails when using stack stomping (-gx)
Comment #10 by github-bugzilla — 2016-03-28T14:23:01Z