-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When mixing C++, ObjC++, and ObjC, something goes wrong in stack unwinding and a crash (abort) ensues #320
Comments
Thanks for the report. Unfortunately, things that depend on GNUstep Make are not reproducible because they add a load of flags to the build that are set when you configure GNUstep Make. And, with dependencies on Foundation, things are not possible to integrate with our testing infrastructure. Is it possible for you to provide a minimal reproducible case? Something with no dependencies outside libobjc2 and with all of the command-line flags that you provide? From the provided files, I can't tell which ABI you're using. The old GCC ABI had a lot of limitations and I'd expect a crash in this case, the GNUstep 2.0 ABI should have fixed them (but may still contain bugs) and I think the GNUstep 1.0 ABI mostly fixed them but had a few corner cases. |
Thanks. I'm building with clang/llvm, and with these configure options for gnustep-make:
…--enable-objc-nonfragile-abi=yes --enable-native-objc-exceptions=yes --with-library-combo=ng-gnu-gnu
which I think means I'm using the new ABI.
I will try to shrink the test case down to a more minimal one but I won't be able to spend time on that for a few days.
- lc
On Dec 8, 2024, at 06:41, David Chisnall ***@***.***> wrote:
Thanks for the report. Unfortunately, things that depend on GNUstep Make are not reproducible because they add a load of flags to the build that are set when you configure GNUstep Make. And, with dependencies on Foundation, things are not possible to integrate with our testing infrastructure. Is it possible for you to provide a minimal reproducible case? Something with no dependencies outside libobjc2 and with all of the command-line flags that you provide?
From the provided files, I can't tell which ABI you're using. The old GCC ABI had a lot of limitations and I'd expect a crash in this case, the GNUstep 2.0 ABI should have fixed them (but may still contain bugs) and I think the GNUstep 1.0 ABI mostly fixed them but had a few corner cases.
—
Reply to this email directly, view it on GitHub <#320 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABY5W6N3CL4FDW7QWTONCHL2EQV43AVCNFSM6AAAAABTGLCFGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRVGY3TMMRWGA>.
You are receiving this because you authored the thread.
|
I haven't used GNUstep Make for many years, but I think the ng thing means that it will pass |
I boiled this down from a large codebase into the tiniest example I could manage, but it's still six files (including the GNUmakefile) so I'm attaching a tarball. The code executes normally on macOS:
but on gnustep/linux (Ubuntu 20.04, gnustep-base 1.27.0, libobjc2 2.0.1) it crashes with an abort in libobjc2/eh_personality.c:
with this stack:
Weirdly, any of the following tweaks to the code makes the crash go away:
Reversing the order of the tests, changing this:
to this:
Inlining the C++ ctor and dtor, by omitting utest.cc and changing the declarations in utest.h from this:
to this:
or eliminating the allocation of an xid object in
-[Xid init]
by removing this line:There's only one call to
abort()
inobjc_begin_catch
:so I suspect something is not cleaning out
td->caughtExceptions
properly, but I'm not familiar enough with libobjc2 internals to say any more than that.The text was updated successfully, but these errors were encountered: