dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.64k stars 4.57k forks source link

ConcurrentDictionary.TryGetValue crashes with System.IndexOutOfRangeException: Arg_IndexOutOfRangeException #102545

Open igor-sidorovich opened 2 months ago

igor-sidorovich commented 2 months ago

Description

Since updating from Xamarin to .NET 8 we are getting next crashes in ConcurrentDictionary.

00:49:25:118|FATAL| 6|AndroidRestCrashHandler|-Core-|AndroidEnvironment.UnhandledExceptionRaiser. UtcNow is 2024-04-09T19:19:25. --> System.IndexOutOfRangeException: Arg_IndexOutOfRangeException at System.Collections.Concurrent.ConcurrentDictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[BB.Features.Resources.Remote.Models.RemoteResourcePackage, BB.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].TryGetValue(String key, RemoteResourcePackage& value)

For me it looks like strange to have such crashes for ConcurrentDictionary.

Original issue link with detailed information - https://github.com/xamarin/xamarin-android/issues/8866.

Reproduction Steps

Unfortuantle, i do not have repro(I tried but didn't succeed), but on Production we see such crashes.

Expected behavior

No any crashes

Actual behavior

00:49:25:118|FATAL| 6|AndroidRestCrashHandler|-Core-|AndroidEnvironment.UnhandledExceptionRaiser. UtcNow is 2024-04-09T19:19:25. --> System.IndexOutOfRangeException: Arg_IndexOutOfRangeException at System.Collections.Concurrent.ConcurrentDictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[BB.Features.Resources.Remote.Models.RemoteResourcePackage, BB.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].TryGetValue(String key, RemoteResourcePackage& value)

Regression?

No response

Known Workarounds

No response

Configuration

List of crashed devices:

Device OS
realme 3 Android 10
Redmi 13C Android 14
A58 Android 13
Redmi 8 Android 10
V2027 Android 12
Galaxy S23 Ultra Android 14
HUAWEI P30 lite Android 10
moto g(30) Android 12
Alcatel 1SE Android 10
ZERO X Pro Android 11
Galaxy A22s 5G Android 13

Other information

No response

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @dotnet/area-system-collections See info in area-owners.md if you want to be subscribed.

igor-sidorovich commented 2 months ago

@jeffhandley

eiriktsarpalis commented 3 weeks ago

As with https://github.com/dotnet/android/issues/8866, we would need some sort of repro before we can take a look at this.

dotnet-policy-service[bot] commented 3 weeks ago

This issue has been marked needs-author-action and may be missing some important information.

dotnet-policy-service[bot] commented 1 week ago

This issue has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.