-
Notifications
You must be signed in to change notification settings - Fork 555
Description
When running our app that's linked to a native C++ library, any exception thrown by that library causes the application to terminate with libstdc++:abi terminated due to uncaught exception <library type> when deployed to device.
This particular library is developed by us, has not been changed for many months and makes use of exceptions for control flow.
Issue first started to occur with the upgrade to XCode 14. It only happens when deploying to physical devices (iOS 12 -> 16). Simulators are not effected.
Everything below was tested on Visual Studio Mac 2022 v17.3.8 (Build 5) (Run on both an Intel and M1 powered Mac)
XCode 13.4.1 / Xamarin iOS 15.10.0.5 => Application runs as expected
XCode 14.0.1 / Xamarin iOS 15.10.0.5 => Application crashes due to uncaught exception
XCode 14.0.1 / Xamarin iOS 16.0.0.72 => Application crashes due to uncaught exception
XCode 14.1.0 / Xamarin iOS 16.0.0.72 => Application crashes due to uncaught exception
The following occurs when our library was built with XCode 9 & XCode 14.
If our library is built in DEBUG mode (-g -O0) the problem does not occur
If our library is built in RELEASE mode with either -O0 or -O1, the problem does not occur
If our library is built in RELEASE mode with either -O2 or -O3 the problem occurs.
When the problem occurs, and based on my rudimentary understanding, it's almost as when the exception is thrown, it fails to unwind the stack to the appropriate catch block and ends up treating it as unhandled.
Are you aware of anything that has changed with the introduction to XCode 14 and linking native code to Xamarin.iOS applications?
As our project it quite large, I am in the process of trying to obtain a small reprodicable example. If it is to do with how optmisations are applied, I might not be able to achieve that.