Skip to content

Crash When Enabling Threading Events on Windows #48407

@brianrob

Description

@brianrob

Description

When running the latest dotnet SDK with threading events enabled, writing out the ThreadPoolWorkerThreadStart event causes a crash.

Steps:

  1. Build the tip of https://github.com/dotnet/installer. The latest official build does not consume the latest runtime yet.
  2. Start a PerfView session: PerfView.exe collect /ThreadTime
  3. Run dotnet new console

The following is output:

Fatal error. Internal CLR error. (0x80131506)
   at System.Diagnostics.Tracing.NativeRuntimeEventSource.ThreadPoolWorkerThreadStart(UInt32, UInt32, UInt16)
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

This is the full stack under a debugger:

00 (Inline Function) --------`-------- coreclr!ECall::GetQCallImpl+0x19 [D:\workspace\_work\1\s\src\coreclr\vm\ecall.cpp @ 691] 
01 000000bf`e69ff490 00007ffa`689f2605 coreclr!NDirect::NDirectLink+0x85 [D:\workspace\_work\1\s\src\coreclr\vm\dllimport.cpp @ 6373] 
02 000000bf`e69ff7b0 00007ffa`68b1edc3 coreclr!NDirectImportWorker+0x75 [D:\workspace\_work\1\s\src\coreclr\vm\dllimport.cpp @ 6554] 
03 000000bf`e69ff830 00007ffa`642d2cd1 coreclr!NDirectImportThunk+0x43
04 000000bf`e69ff8a0 00007ffa`641ccd7d System_Private_CoreLib!System.Diagnostics.Tracing.NativeRuntimeEventSource.ThreadPoolWorkerThreadStart(UInt32, UInt32, UInt16)+0x91
05 000000bf`e69ff990 00007ffa`641b39b5 System_Private_CoreLib!System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()+0x9d
06 000000bf`e69ffa90 00007ffa`68b1f213 System_Private_CoreLib!System.Threading.Thread.StartCallback()+0x65
07 000000bf`e69ffad0 00007ffa`68a08888 coreclr!CallDescrWorkerInternal+0x83
08 000000bf`e69ffb10 00007ffa`68ac0dc9 coreclr!DispatchCallSimple+0x80 [D:\workspace\_work\1\s\src\coreclr\vm\callhelpers.cpp @ 225] 
09 000000bf`e69ffba0 00007ffa`68b3d3cc coreclr!ThreadNative::KickOffThread_Worker+0x89 [D:\workspace\_work\1\s\src\coreclr\vm\comsynchronizable.cpp @ 158] 
0a (Inline Function) --------`-------- coreclr!ManagedThreadBase_DispatchInner+0xd [D:\workspace\_work\1\s\src\coreclr\vm\threads.cpp @ 7299] 
0b 000000bf`e69ffc00 00007ffa`68b3d701 coreclr!ManagedThreadBase_DispatchMiddle+0x8c [D:\workspace\_work\1\s\src\coreclr\vm\threads.cpp @ 7343] 
0c 000000bf`e69ffcc0 00007ffa`68b3d80d coreclr!ManagedThreadBase_DispatchOuter+0xb1 [D:\workspace\_work\1\s\src\coreclr\vm\threads.cpp @ 7503] 
0d 000000bf`e69ffd60 00007ffa`68b0fe1c coreclr!ManagedThreadBase_FullTransition+0x1d [D:\workspace\_work\1\s\src\coreclr\vm\threads.cpp @ 7549] 
0e (Inline Function) --------`-------- coreclr!ManagedThreadBase::KickOff+0x1c [D:\workspace\_work\1\s\src\coreclr\vm\threads.cpp @ 7583] 
0f 000000bf`e69ffdb0 00007ffb`00197034 coreclr!ThreadNative::KickOffThread+0xdc [D:\workspace\_work\1\s\src\coreclr\vm\comsynchronizable.cpp @ 230] 
10 000000bf`e69ffe20 00007ffb`01a5d241 KERNEL32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 64] 
11 000000bf`e69ffe50 00000000`00000000 ntdll!RtlUserThreadStart+0x21 [minkernel\ntdll\rtlstrt.c @ 1153] 

Configuration

Windows x64

Regression?

Yes, this is a regression.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions