autc04 / Retro68

a gcc-based cross-compiler for classic 68K and PPC Macintoshes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash in classify_object_over_fdes when a C++ exception occurs

ryandesign opened this issue · comments

When a C++ object can't be constructed (including due to out of memory), an exception is thrown. The app I'm developing is full of C++ objects so I can't avoid that this situation might arise, so I use try around my main event loop and catch any exception that's thrown in order to show an error dialog box. This was working, but now (after rewriting the procedural parts of my app as C++ objects) when an exception is thrown it crashes in classify_object_over_fdes.

I found this promising-looking 2020 void linux bug report about a 2016 bug in gcc that even now hasn't been fixed yet, but applying the proposed fix did not fix the problem for me.

A 2006 redhat linux bug report about a similar problem pointed the blame at a binutils bug (no URL provided). Since that was so long ago, maybe that bug has been fixed by now.

In both cases, the gist of the problem was that the .eh_frame does not end with the proper terminator. I'm not particularly clear on what that means however.

Correction: This seems to be another symptom caused by using -Wl,--gc-sections; see #184 for others.