Closed ericstj closed 1 month ago
Tagging subscribers to this area: @cston See info in area-owners.md if you want to be subscribed.
Let me take a look; this seems to be happing frequently.
Based on the windows x64 crash in https://dev.azure.com/dnceng-public/public/_build/results?buildId=764230&view=ms.vss-test-web.build-test-results-tab&runId=19436920&resultId=218614&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab
There is a delegate that blows up the process when invoked. The method invoking the delegate is minopts.
0:010> !DumpObj /d 00000136ce117488
Name: System.Func`2[[System.Linq.Expressions.Tests.IncDecAssignTests+TestPropertyClass`1[[System.Int32, System.Private.CoreLib]], System.Linq.Expressions.Tests],[System.Int32, System.Private.CoreLib]]
MethodTable: 00007fff9bd6aaa0
EEClass: 00007fff9a59b7e8
Tracked Type: false
Size: 64(0x40) bytes
File: C:\h\w\B8A309B6\p\shared\Microsoft.NETCore.App\9.0.0\System.Private.CoreLib.dll
Fields:
MT Field Offset Type VT Attr Value Name
00007fff998d4530 400021c 8 System.Object 0 instance 00000136ce117488 _target
00007fff998d4530 400021d 10 System.Object 0 instance 00000136ce116978 _methodBase
00007fff99a15170 400021e 18 System.IntPtr 1 instance 00007FFF9AD5F010 _methodPtr
00007fff99a15170 400021f 20 System.IntPtr 1 instance 00007FFF9BD4A0E8 _methodPtrAux
00007fff998d4530 40002c3 28 System.Object 0 instance 0000000000000000 _invocationList
00007fff99a15170 40002c4 30 System.IntPtr 1 instance 0000000000000000 _invocationCount
Here the methodPtr is an invalid address. The methodPtrAux field is an indirection cell for
0:010> !ip2md 00007fff`9ba11e90
MethodDesc: 00007fff9bd6a100
Method Name: System.Linq.Expressions.Tests.IncDecAssignTests+TestPropertyClass`1[[System.Int32, System.Private.CoreLib]].get_TestInstance()
Class: 00007fff9bd6a148
MethodTable: 00007fff9bd6a148
mdToken: 0000000006004518
Module: 00007fff9a2e25a0
IsJitted: yes
Current CodeAddr: 00007fff9ba11e90
Version History:
ILCodeVersion: 0000000000000000
ReJIT ID: 0
IL Addr: 00000177600f5b5b
CodeAddr: 00007fff9ba11e90 (MinOptJitted)
NativeCodeVersion: 0000000000000000
Locally (using CI assets) I was able to get 5 crashes in 200 runs, so I may be able to catch this live in the debugger.
Aside from the AV there were also crashes like
Fatal error. Internal CLR error. (0x80131506)
at System.Delegate.<BindToMethodInfo>g____PInvoke|21_0(System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.ObjectHandleOnStack, System.RuntimeMethodHandleInternal, System.Runtime.CompilerServices.QCallTypeHandle, System.DelegateBindingFlags)
at System.Delegate.CreateDelegateInternal(System.RuntimeType, System.Reflection.RuntimeMethodInfo, System.Object, System.DelegateBindingFlags)
at System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(System.Type, System.Object, System.DelegateBindingFlags)
at System.Linq.Expressions.Interpreter.FuncCallInstruction`2[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(System.Reflection.MethodInfo)
at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(System.Object, System.Span`1<System.Object>, System.Reflection.BindingFlags)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
Based on the above my guess is that this is an issue in the runtime with stub management?
cc @mangod9
Don't believe there have been any recent changes I am aware of which might affect this. We can take a look though. Also adding @janvorli @VSadov if it rings a bell?
Can't quite figure out how to script this under the debugger, because some of the tests intentionally divide by zero.
Adding @AaronRobinsonMSFT ? - some delegate changes were made in https://github.com/dotnet/runtime/pull/105584 on Jul 27 which was a couple days before the first report on July 29.
this looks similar to https://github.com/dotnet/runtime/pull/106072#issuecomment-2276356612, and a possible root cause PR has been reverted.
I think this was fixed with https://github.com/dotnet/runtime/pull/106072#issuecomment-2278438726
/cc @jkotas
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=759698 Build error leg or test failing: System.Linq.Expressions.Tests.WorkItemExecution Pull request: https://github.com/dotnet/runtime/pull/105636
Error Message
Fill the error message using step by step known issues guidance.
Log: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-105636-merge-95523dd4fead49c19e/System.Linq.Expressions.Tests/1/console.673b37a5.log?helixlogtype=result Dump: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-105636-merge-95523dd4fead49c19e/System.Linq.Expressions.Tests/1/coredump.20.dmp?helixlogtype=result
Relevant portion of crash analysis, some symbols missing cc @hoyosjs
Could be reflection, or codegen. cc @steveharter @AndyAyersMS in case they see anything.
Known issue validation
Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=759698 Error message validated:
[SIGSEGV Illegal memory access. Deref invalid pointer, overrunning buffer System.Linq.Expressions.Interpreter.FuncCallInstruction
] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 7/30/2024 4:08:57 PM UTCReport
Summary