You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS app crashes on release mode when performing a .Sum on a List of 20k+ items #97625
Our production app is crashing without leaving any stacktrace when performing a .Sum or .Average on a List of ~20k items in release mode.
When manually performing the operation in a foreach instead of using .Sum, works as expected.
I have also tried to replicate the .Sum method on my code to see where the issue arises, and it seems that the use of Generics is what is making the app to crash, when changing the generics data types to defined data types, the app does not crash.
I have attached a basic reproduction app.
Steps to Reproduce
Create a new dotnet MAUI app.
Create a List of a custom model with one of the properties being a decimal.
Add 20k elements to the list.
Perform a List.Sum(x=>x.DecimalProperty)
Expected result:
To perform the sum of the items.
Actual results:
The app crashes when attempting to perform the operation, but only on Release mode, works as expected when on Debug mode
I checked out your project and I couldn't reproduce a crash on simulator nor device with Release mode. I also created a generic iOS project using your code and couldn't get it to crash there either. If there is a crash, in all likelihood, it would be a runtime issue rather than a MAUI UI issue, but seeing that in your app, CollectionView was causing the UI to perform very poorly and at a low framerate, my guess is that control might be causing more issues that could lead to whatever crash you're having.
Could you try my repro project and see if that crashes on your device.
@rolfbjarne Would you know of more ways to get more information about this crash this user is having?
Hey @drasticactions, I tried with your repro project, and is also crashing for me in release mode using my physical device iPhone XS Max iOS Version 17.2.
I also tried to make it crash using an emulator (which I haven't tried before) but I was not able to reproduce there, so must be physical devices only.
Attached the video of the crash, the logs and crash report which I generated with your repro app. DeviceLogs.zip GenericCrash-2024-01-26-072406.ips.zip
I agree - especially since it was customer reported. It should be easy to make the case to get this to servicing. @vargaz could you please backport the fix to 8.0-servicing?
Activity
drasticactions commentedon Jan 25, 2024
I checked out your project and I couldn't reproduce a crash on simulator nor device with Release mode. I also created a generic iOS project using your code and couldn't get it to crash there either. If there is a crash, in all likelihood, it would be a runtime issue rather than a MAUI UI issue, but seeing that in your app, CollectionView was causing the UI to perform very poorly and at a low framerate, my guess is that control might be causing more issues that could lead to whatever crash you're having.
Could you try my repro project and see if that crashes on your device.
@rolfbjarne Would you know of more ways to get more information about this crash this user is having?
rolfbjarne commentedon Jan 25, 2024
Either of these (preferrably both) could be useful:
andyx48 commentedon Jan 25, 2024
Hey @drasticactions, I tried with your repro project, and is also crashing for me in release mode using my physical device iPhone XS Max iOS Version 17.2.
I also tried to make it crash using an emulator (which I haven't tried before) but I was not able to reproduce there, so must be physical devices only.
Attached the video of the crash, the logs and crash report which I generated with your repro app.
DeviceLogs.zip
GenericCrash-2024-01-26-072406.ips.zip
RPReplay_Final1706217849.MP4
rolfbjarne commentedon Jan 26, 2024
Unfortunately the native stack trace isn't all that helpful, because native symbols were stripped:
Can you add the following to the csproj, try again and get an updated crash report?
That should make the stack trace better.
BTW the device log didn't show anything useful, so there's no need to get an updated version of that.
andyx48 commentedon Jan 28, 2024
No problem, here the crash report with
<NoSymbolStrip>true</NoSymbolStrip>GenericCrash-2024-01-29-071217.ips.zip
rolfbjarne commentedon Jan 29, 2024
OK, that's a better crash report:
rolfbjarne commentedon Jan 29, 2024
I can reproduce the crash, and this looks like something for dotnet/runtime.
rolfbjarne commentedon Jan 29, 2024
Crash in lldb:
rolfbjarne commentedon Jan 29, 2024
FWIW I reproduced using @drasticactions's project: https://github.com/drasticactions/MauiRepros/tree/main/GenericCrash, and building it like this:
8 remaining items
charlesroddie commentedon Jan 30, 2024
This is the same as #97224 in that it involves ios, mono aot, gc writebarrier, linq average, and decimal.
The crash we are getting is vaguely similar but involves ios, gc, a writing guard exception, and linq. But it's coreclr/nativeaot and no decimal.
ivanpovazan commentedon Jan 31, 2024
FWIW, these were detected as failures on tvos-arm64 runs and relevant tests got disabled in #97511
As @charlesroddie suggested the tracking issue is: #97224
[mono][jit] Fix passing of byref arguments in mono_gsharedvt_constrai…
[mono][jit] Fix passing of byref arguments in mono_gsharedvt_constrai…
steveisok commentedon Jan 31, 2024
@vitek-karas since this was hit in .net 8, it would make sense to backport #97721. What do you think?
vitek-karas commentedon Feb 1, 2024
I agree - especially since it was customer reported. It should be easy to make the case to get this to servicing.
@vargaz could you please backport the fix to 8.0-servicing?
[release/8.0-staging] [mono][jit] Fix passing of byref arguments in m…
[release/8.0-staging] [mono][jit] Fix passing of byref arguments in m…