dotnet / runtime

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

Assertion failed `(pThread->m_StateNC & Thread::TSNC_OwnsSpinLock) == 0` #104449

Closed jakobbotsch closed 3 weeks ago

jakobbotsch commented 3 months ago

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=730601 Build error leg or test failing: System.Reflection.Tests.WorkItemExecution Pull request: https://github.com/dotnet/runtime/pull/104429

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "(pThread->m_StateNC & Thread::TSNC_OwnsSpinLock) == 0",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=730601 Error message validated: [(pThread->m_StateNC & Thread::TSNC_OwnsSpinLock) == 0] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 7/4/2024 7:50:45 PM UTC

Report

Build Definition Test Pull Request
801531 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107531
799241 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107403
797869 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107371
797585 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107358
795103 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#104503
794876 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107201
794247 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107147
791535 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#107089
786597 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#105771
785657 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#106830
783356 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#106683
780692 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#106599
776253 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#100294
776248 dotnet/runtime System.Reflection.Tests.WorkItemExecution dotnet/runtime#106314

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 4 14
dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @mangod9 See info in area-owners.md if you want to be subscribed.

jkotas commented 3 months ago

Stacktrace:

DbgAssertDialog
CrstBase::PreEnter()
CrstBase::Enter(CrstBase::NoLevelCheckFlag)
TableCacheMissOnFree(HandleTable*, HandleTypeCache*, unsigned int, OBJECTHANDLE__*)
HndDestroyHandle(HandleTable*, unsigned int, OBJECTHANDLE__*)
GetThreadLocalStaticBase(TLSIndex)
Thread::GetStaticFieldAddress(FieldDesc*)
InvokeUtil::GetFieldValue(FieldDesc*, TypeHandle, OBJECTREF*, TypeHandle, bool*)
RuntimeFieldHandle::GetValue(ReflectFieldObject*, Object*, ReflectClassBaseObject*, ReflectClassBaseObject*, bool*)
System.Reflection.FieldAccessor.GetValue(System.Object)
jkotas commented 3 months ago

Looks like a regression introduced by the statics rewrite. @davidwrighton Could you please take a look?

amanasifkhalid commented 1 month ago

Hi @davidwrighton, we're periodically hitting this in runtime-coreclr libraries-jitstress-random (example run). Could you PTAL? Thanks!

mangod9 commented 1 month ago

@davidwrighton, this issue is marked for 9. Are you planning to investigate since it's blocking clean-ci-optional?