iOS18 and Xcode 16 native libraries SIGSEV segmentation fault #27209
Labels
platform/iOS 🍎
potential-regression
This issue described a possible regression on a currently supported version., verification pending
t/bug
Something isn't working
Description
Segmentation fault SIGSEV when hitting one specific function of our native libraries (Obj-C & C) upon running our unit test app in an iOS 18.2.1 iPhoneXR.
The native library is binded to .net-ios/MAUI using a classical recommended ApiDefinition.cs way.
My suspicions are around multi thread (xUnit tests are running in parallel) and something that might have fundamentally changed memory wise in iOS 18.X / xCode 16.X. However, the logs for those do not specify anything in that regard.
Any help would be much appreciated.
Can provide eventually a repro project (not made yet) but want to test the waters first!
Regards
Log provided is already with:
Development environment
Development environment where issue occurs:
Development environment where issue does not occur:
When running in devices iOS < 18.X the issue does not occur independently of the development environment used. This seems specific to iOS 18 and compiling using xCode 16.2 (embedded component iOS SDK 18.2).
Specific function that causes the SIGSEV crash
.net binding ApiDefinition.cs
Obj-C method
csproj
Removed some applicationId's, names and resources etc that are not relevant for this:
Steps to Reproduce
Expected outcome: tests passing
Actual outcome: SIGSEV native library crash
Link to public reproduction project repository
No response
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.20 SR4
Affected platforms
iOS
Affected platform versions
iOS 18.2.1 (suspected all iOS 18.X.X)
Did you find any workaround?
Not yet.
The bindings are done using IntPtr on .net side -> pointer to typed arrays in Obj-C (int*, float*, ...)
Tried a few things around changing order of the arguments in the binding project.
Tried not using the current fixed (unsafe) statements and use (safe) code, example:
instead of
Tried nested fixed statements to ensure memory doenst get removed by GC
Some other stuff that i honestly can't remember - it's been a couple of days
Relevant log output
The text was updated successfully, but these errors were encountered: