Reputation: 75
We use mono 4.8.0 for our product. When running particular testings on different kinds of Linux, we got unhandled exception triggered occasionally. More specifically AppDomain.UnhandledException event triggered. But we can't figure out which line of our code triggered the exception. I'm wondering is this a defect of mono?
[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: ExecutionContext_ExceptionInAsyncLocalNotification ---> System.Threading.ThreadAbortException at System.Collections.Generic.ObjectEqualityComparer'1[T].Equals (T x, T y) <0x7f0f20aa1e80 + 0x00000> in :0 at System.Collections.Generic.Dictionary'2[TKey,TValue].FindEntry (TKey key) [0x0005d] in :0 at System.Collections.Generic.Dictionary'2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in :0 at System.Threading.ExecutionContext.OnAsyncLocalContextChanged (System.Threading.ExecutionContext previous, System.Threading.ExecutionContext current) [0x00119] in ...../mono/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:749 --- End of inner exception stack trace --- at System.Environment.FailFast (System.String message, System.Exception exception) [0x00000] in ...../mono/mono/mcs/class/corlib/System/Environment.cs:929 at System.Threading.ExecutionContext.OnAsyncLocalContextChanged (System.Threading.ExecutionContext previous, System.Threading.ExecutionContext current) [0x00164] in ..../mono/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:758 at System.Threading.ExecutionContext.SetExecutionContext (System.Threading.ExecutionContext executionContext, System.Boolean preserveSyncCtx) [0x0005f] in ..../mono/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:1028
Thanks
Upvotes: 0
Views: 688
Reputation: 11
Try <AppContextSwitchOverrides value="Switch.System.Globalization.NoAsyncCurrentCulture=true" />
and avoid using AsyncLocal<T>
Upvotes: 0