Repository navigation
Random crashes #160
Description
Activity
Hi @tmoers - curious, your test as written looks perfectly legitimate and I can't see offhand why it would randomly fail. The stack trace seems to indicate the issue may be within the FSharp.Core quotation code itself. Perhaps some kind of assembly loading race condition (just a hunch). I wonder if the issue could be reproduce by running the code in a loop or something like that (again just thinking aloud). I'll reflect on it a bit and maybe try some things to see if I can reproduce.
- addedupstreamSource of issue is possibly upstream to Unquote (e.g. FSharp.Core)Source of issue is possibly upstream to Unquote (e.g. FSharp.Core)
on Dec 31, 2023 Closing this issue as it is old and hasn't come up again and appeared to be upstream at the time.
Still happening with SDK 10.0.302 in CI (Release build, running on TeamCity windows agent)
(innocuous comparingGuid.Parseoutput toGuid.TryParseinvoked via a partialFSharpFuncwith literals i.e. the test did not fail)
same stacktrace though line numbers have shiftedFull stack trace from 10.0.303 on my desktop
System.NullReferenceException : Object reference not set to an instance of an object. from <Path>\tests\bin\Debug\net10.0\<Project>.Tests.dll (net10.0|x64) Xunit.MicrosoftTestingPlatform.XunitException: System.NullReferenceException : Object reference not set to an instance of an object. at Microsoft.FSharp.Quotations.FSharpVar..ctor(String name, Type typ, FSharpOption`1 isMutable) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:109 at Microsoft.FSharp.Quotations.PatternsModule.u_VarDecl@2003.Invoke(BindingEnv env) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:2003 at Microsoft.FSharp.Quotations.PatternsModule.u_Expr@1981-2.Invoke(BindingEnv env) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:1981 at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\local.fs:247 at Microsoft.FSharp.Quotations.PatternsModule.u_Expr@1963.Invoke(BindingEnv env) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:1964 at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\local.fs:238 at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\local.fs:248 at Microsoft.FSharp.Quotations.PatternsModule.u_Expr@1963.Invoke(BindingEnv env) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:1964 at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\local.fs:238 at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\local.fs:248 at Microsoft.FSharp.Quotations.PatternsModule.u_Expr@1963.Invoke(BindingEnv env) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:1964 at Microsoft.FSharp.Quotations.PatternsModule.u_Expr@1992-5.Invoke(BindingEnv env) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:1992 at Microsoft.FSharp.Quotations.PatternsModule.deserialize(Type localAssembly, Type[] referencedTypeDefs, Type[] spliceTypes, FSharpExpr[] spliceExprs, Byte[] bytes) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:2488 at Microsoft.FSharp.Quotations.FSharpExpr.Deserialize40(Type qualifyingType, Type[] referencedTypes, Type[] spliceTypes, FSharpExpr[] spliceExprs, Byte[] bytes) in D:\a\_work\1\s\src\fsharp\src\FSharp.Core\quotations.fs:2699 at Tomra.Xcd.Nucleus.MachineStatus.Health.Monitoring.Monitoring.EjectionHealthStatusTests.Ejection statistics with more than 10 percent refused lines are considered as Error() in Nucleus\src\Nucleus.MachineStatus\Health\tests\Monitoring\EjectionHealthStatusTests.fs:48 at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Every once in a while we have two tests that fail and we get this call stack in the exception:
This is the test:
And this is the code being tested:
I have no clue why it sometimes fails. It's all pure, nothing changes. I'm not saying it's Unquote that's at fault here, but I'm wondering if this rings a bell or if I'm maybe doing something incorrect here?