-
Notifications
You must be signed in to change notification settings - Fork 518
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
iOS18 and Xcode 16 native libraries SIGSEV segmentation fault #22007
Comments
Issue moved from dotnet/maui#27209
From @amdlopes on Friday, January 17, 2025 8:24:33 PM Some edits with more info and correct console log from device. |
@PureWeen could i please have permissions to edit the original ticket or is that not possible as soon as you move it? Anyway, if not possible... Tried a few more things:
|
if it's alright let's leave the conversation here until @rolfbjarne and team can weigh in |
I've done some further testing on multiple devices with diff iOS versions (16.X and 18.2.1), changes around csprojs, .net targeting, etc... Unit test app In iOS 16.X devices i can run all tests multiple times with no issues in both Debug and Release configs. In iOS 18.2.1 devices i can't run multiple times but generally (99.9%) of the times i can run at least one complete full run, the crash (above) only happens on the subsequent multiple runs. Integration app I'm getting out of ideas here and would appreciate your help. |
Issue moved from dotnet/maui#27209
From @amdlopes on Friday, January 17, 2025 3:55:37 PM
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: