-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
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
Link to public reproduction project repository
https://github.com/andyx48/GenericsCrashRepro
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15 and up to the latest version
Did you find any workaround?
No
Relevant log output
No response