Skip to content
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

Please, help to investigate ArgumentOutOfRangeException: The Month parameter must be in the range 1 through 12. #5205

Closed
ivmazurenko opened this issue Oct 14, 2020 · 5 comments
Labels
Area: App Runtime Issues in `libmonodroid.so`. need-info Issues that need more information from the author.

Comments

@ivmazurenko
Copy link

Steps to Reproduce

  1. Instantiate this class on the android app.

Executor.cs.txt

Expected Behavior

No error.

Actual Behavior

Very rarely this exception is reported.

4016ms|2020-09-21 19:34:11.3824|Error|TID:3:Main |MobileExceptionHandler|Unhandled exception 32762d04-2163-4bcd-b29b-a237504912a9System.ArgumentOutOfRangeException: The Month parameter must be in the range 1 through 12.
Parameter name: month
  at System.TimeZoneInfo+TransitionTime.ValidateTransitionTime (System.DateTime timeOfDay, System.Int32 month, System.Int32 week, System.Int32 day, System.DayOfWeek dayOfWeek) [0x00036] in <0d5074f38d174905827f23e71ff9468a>:0 
  at System.TimeZoneInfo+TransitionTime.CreateTransitionTime (System.DateTime timeOfDay, System.Int32 month, System.Int32 week, System.Int32 day, System.DayOfWeek dayOfWeek, System.Boolean isFixedDateRule) [0x00000] in <0d5074f38d174905827f23e71ff9468a>:0 
  at System.TimeZoneInfo+TransitionTime.CreateFixedDateRule (System.DateTime timeOfDay, System.Int32 month, System.Int32 day) [0x00000] in <0d5074f38d174905827f23e71ff9468a>:0 
  at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_static_void_method_a(intptr,intptr&,intptr,intptr,intptr)
  at Java.Interop.JniEnvironment+StaticMethods.CallStaticVoidMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00059] in <1c22ce781ff64a2f9f59ab1e460019b5>:0 
  at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeVoidMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00018] in <1c22ce781ff64a2f9f59ab1e460019b5>:0 
  at Android.OS.Looper.Loop () [0x0000a] in <4d6506e72af94608bbea6cce1574ee59>:0 
  at Mobile.Droid.cTrader.Infrastructure.Threading.DroidMainThreadExecutor.Loop () [0x0008f] in <2c769aa539f74633985209711fb4b80f>:0 
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <0d5074f38d174905827f23e71ff9468a>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <0d5074f38d174905827f23e71ff9468a>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <0d5074f38d174905827f23e71ff9468a>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <0d5074f38d174905827f23e71ff9468a>:0 
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <0d5074f38d174905827f23e71ff9468a>:0 

Version Information

Microsoft Visual Studio Community 2019
Version 16.7.1
VisualStudio.16.Release/16.7.1+30406.217
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

ASP.NET and Web Tools 2019 16.7.532.28833
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services 16.1.0.2035807+72d099b977d3a85e65fa3b0614ca8cfc803fef02
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019 16.7.532.28833
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.7.532.28833
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.7.532.28833
Azure Functions and Web Jobs Tools

C# Tools 3.7.0-6.20375.2+34202cc2f3e869fd70a26d8237f4552cf9e192cf
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30701.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.79+ge3567815aa.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Mono Debugging for Visual Studio 16.7.5 (112c7bc)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62008.03130
Microsoft SQL Server Data Tools

TypeScript Tools 16.0.20702.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.7.0-6.20375.2+34202cc2f3e869fd70a26d8237f4552cf9e192cf
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.10.0.0 for F# 4.7 16.7.0-beta.20361.3+3ef6f0b514198c0bfa6c2c09fefe41a740b024d5
Microsoft Visual F# Tools 10.10.0.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.7.000.440 (d16-7@358f3c6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.7.0.495 (remotes/origin/d16-7@79c0c522c)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.7.85 (1bcbbdf)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.0.0.3 (d16-7/aca845b)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

Xamarin.iOS and Xamarin.Mac SDK 13.20.2.2 (817b6f72a)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

report-android.txt

@ivmazurenko ivmazurenko added the Area: App Runtime Issues in `libmonodroid.so`. label Oct 14, 2020
@pjcollins pjcollins added the need-info Issues that need more information from the author. label Oct 14, 2020
@pjcollins
Copy link
Member

You mentioned that this error rarely occurs, do you have a rough estimate on the frequency of this crash? I tried to create a self contained reproduction for this case but I couldn't get it to crash:

App14.zip

Does this app crash on your device? If not, would you be able to attach a self contained reproduction that is failing for you?

@ivmazurenko
Copy link
Author

@pjcollins Hello, and thank you for your quick response.

We have about 3-5 reports at week. This error does not reproduces on my device.

If not, would you be able to attach a self contained reproduction that is failing for you?

As I understood, attached file and included stacktrace contains all required info. This class just instantiated and crashes the android app. It is just included to xamarin native android application. Maybe i will have a time for a repro, but a little bit later.

I have tryed to investigate similar exceptions, can it be related with these posts?
https://stackoverflow.com/questions/57655469/deserializing-timezoneinfo-on-linux-throws-the-month-parameter-must-be-in-the-r

dotnet/runtime#30679

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Dec 18, 2020

@ivmazurenko looking at the stack trace, I don't think we actually have the full picture here.

What is the code for the Action being passed into this class? Does it use DateTime.Now or other System.DateTime-related APIs?

Nothing in the attached Executor.cs file should be using TimeZoneInfo where the crash is occurring.

You could wrap the Action in a try-catch, as a way to prevent the crash:

public void Execute(Action action)
{
    Action wrappedAction = () => {
        try { action(); } catch (Exception ex) { Log.Debug ("YourAppName", "Unhandled Exception: {0}", ex); }
    };
    // ... rest of the code uses wrappedAction
}

But you probably want to actually figure out what is wrong.

@moljac
Copy link
Contributor

moljac commented Jan 19, 2021

@ivmazurenko Would you be so kind and provide more info and feedback? Thanks.

@jonathanpeppers
Copy link
Member

Closing for now, let us know if you can send more info, thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App Runtime Issues in `libmonodroid.so`. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

4 participants