runtime: CoreCLR crashed when CLR ETW provide was activated

The issue in our tracker: https://youtrack.jetbrains.com/issue/DTRC-23500.

Repro:

  1. Activate ETW: xperf -start dot_net_runtime_trace -on e13c0d23-ccbc-4e12-931b-d9cc2eee27e4:0x4001c079 -f C:\dot_net_runtime_trace.etl
  2. Execute ASP .NET Core project from command line dotnet.exe run. Got the AV exception.
  3. Disable ETW: xperf -stop dot_net_runtime_trace

Here stack trace on crash:

(4428.15d0): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
coreclr!ETW::MethodLog::SendEventsForNgenMethods+0x45:
00007ffb`2424c6c9 488b4060        mov     rax,qword ptr [rax+60h] ds:00000000`00000060=????????????????
0:000> kM
 # Child-SP          RetAddr           Call Site
00 0000008d`71b7c2f0 00007ffb`2424d3e4 coreclr!ETW::MethodLog::SendEventsForNgenMethods+0x45
01 0000008d`71b7c370 00007ffb`2424d4c8 coreclr!ETW::EnumerationLog::IterateModule+0x88
02 0000008d`71b7c400 00007ffb`2424a24d coreclr!ETW::EnumerationLog::EnumerationHelper+0x44
03 0000008d`71b7c490 00007ffb`242ba913 coreclr!ETW::LoaderLog::ModuleLoad+0x199
04 0000008d`71b7c550 00007ffb`2438e28c coreclr!Module::NotifyEtwLoadFinished+0x67
05 0000008d`71b7c580 00007ffb`24265f3a coreclr!DomainAssembly::DeliverSyncEvents+0x2c
06 0000008d`71b7c5f0 00007ffb`2447aff3 coreclr!Assembly::CreateDynamic+0xa2a
07 0000008d`71b7cf60 00007ffb`2141b06a coreclr!AppDomainNative::CreateDynamicAssembly+0x163
08 0000008d`71b7d130 00007ffb`2141b583 System_Private_CoreLib_ni+0x6db06a
09 0000008d`71b7d210 00007ffb`21432c2b System_Private_CoreLib_ni+0x6db583
0a 0000008d`71b7d2d0 00007ffb`21432f08 System_Private_CoreLib_ni+0x6f2c2b
0b 0000008d`71b7d380 00007ffb`21432764 System_Private_CoreLib_ni+0x6f2f08
0c 0000008d`71b7d400 00007ffb`26a275e7 System_Private_CoreLib_ni+0x6f2764
0d 0000008d`71b7d470 00007ffb`26a27b93 System_Linq_Expressions+0xd75e7
0e 0000008d`71b7d4d0 00007ffb`269f9ebb System_Linq_Expressions+0xd7b93
*** WARNING: Unable to verify checksum for C:\Program Files\dotnet\sdk\1.0.0-preview2-003121\Newtonsoft.Json.dll
*** ERROR: Module load completed but symbols could not be loaded for C:\Program Files\dotnet\sdk\1.0.0-preview2-003121\Newtonsoft.Json.dll
0f 0000008d`71b7d520 00007ffb`2e6ebf20 System_Linq_Expressions+0xa9ebb
10 0000008d`71b7d550 00007ffb`2e6f6dc9 Newtonsoft_Json+0xabf20
11 0000008d`71b7d5c0 00007ffb`2e6f6ee5 Newtonsoft_Json+0xb6dc9
12 0000008d`71b7d600 00007ffb`2e6f77b5 Newtonsoft_Json+0xb6ee5
13 0000008d`71b7d640 00007ffb`2e6f7ec3 Newtonsoft_Json+0xb77b5
14 0000008d`71b7d6a0 00007ffb`2e6f59b1 Newtonsoft_Json+0xb7ec3
15 0000008d`71b7d6f0 00007ffb`2e70575f Newtonsoft_Json+0xb59b1
16 0000008d`71b7d780 00007ffb`2e6d26b6 Newtonsoft_Json+0xc575f
17 0000008d`71b7d7f0 00007ffb`2e71db9a Newtonsoft_Json+0x926b6
18 0000008d`71b7d8a0 00007ffb`2e717ef0 Newtonsoft_Json+0xddb9a
19 0000008d`71b7d900 00007ffb`2e717eca Newtonsoft_Json+0xd7ef0
*** ERROR: Module load completed but symbols could not be loaded for C:\Program Files\dotnet\sdk\1.0.0-preview2-003121\dotnet.dll
1a 0000008d`71b7d950 00007ffb`338f8a25 Newtonsoft_Json+0xd7eca
1b 0000008d`71b7d980 00007ffb`338f97b5 dotnet_7ffb33870000+0x88a25
1c 0000008d`71b7d9e0 00007ffb`338f8672 dotnet_7ffb33870000+0x897b5
1d 0000008d`71b7da30 00007ffb`338fb10c dotnet_7ffb33870000+0x88672
1e 0000008d`71b7da70 00007ffb`338fadd2 dotnet_7ffb33870000+0x8b10c
1f 0000008d`71b7dae0 00007ffb`338f84d9 dotnet_7ffb33870000+0x8add2
20 0000008d`71b7db60 00007ffb`3390ef8a dotnet_7ffb33870000+0x884d9
Unable to read dynamic function table entries
Unable to read dynamic function table entries
21 0000008d`71b7dba0 00007ffa`c4b8d93f dotnet_7ffb33870000+0x9ef8a
Unable to read dynamic function table entries
Unable to read dynamic function table entries
Unable to read dynamic function table entries
Unable to read dynamic function table entries
Unable to read dynamic function table entries
22 0000008d`71b7dbf0 00007ffa`c4b8d7fa 0x00007ffa`c4b8d93f
Unable to read dynamic function table entries
Unable to read dynamic function table entries
Unable to read dynamic function table entries
Unable to read dynamic function table entries
23 0000008d`71b7dc60 00007ffb`338fa540 0x00007ffa`c4b8d7fa
Unable to read dynamic function table entries
24 0000008d`71b7dca0 00007ffb`33910585 dotnet_7ffb33870000+0x8a540
25 0000008d`71b7dd30 00007ffb`33909c41 dotnet_7ffb33870000+0xa0585
26 0000008d`71b7dd70 00007ffb`338fbdee dotnet_7ffb33870000+0x99c41
27 0000008d`71b7de20 00007ffb`338fa34f dotnet_7ffb33870000+0x8bdee
28 0000008d`71b7de70 00007ffb`338f1d04 dotnet_7ffb33870000+0x8a34f
29 0000008d`71b7ded0 00007ffb`338f189f dotnet_7ffb33870000+0x81d04
2a 0000008d`71b7df70 00007ffb`3390da4b dotnet_7ffb33870000+0x8189f
2b 0000008d`71b7dfa0 00007ffb`33909c41 dotnet_7ffb33870000+0x9da4b
2c 0000008d`71b7dfe0 00007ffb`338f17ad dotnet_7ffb33870000+0x99c41
2d 0000008d`71b7e090 00007ffb`33907d89 dotnet_7ffb33870000+0x817ad
2e 0000008d`71b7e110 00007ffb`3390788a dotnet_7ffb33870000+0x97d89
2f 0000008d`71b7e1c0 00007ffb`24537463 dotnet_7ffb33870000+0x9788a
30 0000008d`71b7e220 00007ffb`242953e3 coreclr!CallDescrWorkerInternal+0x83
31 0000008d`71b7e260 00007ffb`2426731e coreclr!MethodDescCallSite::CallTargetWorker+0x21b
32 0000008d`71b7e370 00007ffb`242675ae coreclr!RunMain+0x226
33 0000008d`71b7e5e0 00007ffb`24217582 coreclr!Assembly::ExecuteMainMethod+0xda
34 0000008d`71b7e8b0 00007ffb`24203255 coreclr!CorHost2::ExecuteAssembly+0x1f2
35 0000008d`71b7e9b0 00007ffb`3409f2c4 coreclr!coreclr_execute_assembly+0x135
36 0000008d`71b7ea40 00007ffb`3409f8c2 hostpolicy!run+0xc44
37 0000008d`71b7f0d0 00007ffb`4733941e hostpolicy!corehost_main+0x222
38 0000008d`71b7f230 00007ffb`4733d63f hostfxr!execute_app+0xae
39 0000008d`71b7f290 00007ffb`4733cd6c hostfxr!fx_muxer_t::read_config_and_execute+0x74f
3a 0000008d`71b7f800 00007ffb`4733baa8 hostfxr!fx_muxer_t::parse_args_and_execute+0x70c
*** WARNING: Unable to verify checksum for dotnet.exe
3b 0000008d`71b7f980 00007ff6`c1eb93f6 hostfxr!fx_muxer_t::execute+0x3d8
3c 0000008d`71b7faf0 00007ff6`c1ebc9cc dotnet!run+0xe6
3d 0000008d`71b7fbb0 00007ffb`6cef8102 dotnet!operator new[]+0x20c
3e 0000008d`71b7fbf0 00007ffb`6d08c5b4 KERNEL32!BaseThreadInitThunk+0x22
3f 0000008d`71b7fc20 00000000`00000000 ntdll!RtlUserThreadStart+0x34
0:000> .load C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\sos.dll
0:000> !clrstack
OS Thread Id: 0x15d0 (0)
        Child SP               IP Call Site
0000008d71b7c7e0 00007ffb2424c6c9 [GCFrame: 0000008d71b7c7e0] 
0000008d71b7d018 00007ffb2424c6c9 [HelperMethodFrame_PROTECTOBJ: 0000008d71b7d018] System.Reflection.Emit.AssemblyBuilder.nCreateDynamicAssembly(System.AppDomain, System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet, Byte[], Byte[], System.Reflection.Emit.AssemblyBuilderAccess, System.Reflection.Emit.DynamicAssemblyFlags, System.Security.SecurityContextSource)
0000008d71b7d130 00007ffb2141b06a System.Reflection.Emit.AssemblyBuilder..ctor(System.AppDomain, System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String, System.Security.Policy.Evidence, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet, System.Threading.StackCrawlMark ByRef, System.Collections.Generic.IEnumerable`1, System.Security.SecurityContextSource)
0000008d71b7d210 00007ffb2141b583 System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String, System.Security.Policy.Evidence, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet, System.Threading.StackCrawlMark ByRef, System.Collections.Generic.IEnumerable`1, System.Security.SecurityContextSource)
0000008d71b7d2d0 00007ffb21432c2b System.Reflection.Emit.DynamicMethod.GetDynamicMethodsModule()
0000008d71b7d380 00007ffb21432f08 System.Reflection.Emit.DynamicMethod.Init(System.String, System.Reflection.MethodAttributes, System.Reflection.CallingConventions, System.Type, System.Type[], System.Type, System.Reflection.Module, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
0000008d71b7d400 00007ffb21432764 System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)
0000008d71b7d470 00007ffb26a275e7 System.Linq.Expressions.Compiler.LambdaCompiler..ctor(System.Linq.Expressions.Compiler.AnalyzedTree, System.Linq.Expressions.LambdaExpression)
0000008d71b7d4d0 00007ffb26a27b93 System.Linq.Expressions.Compiler.LambdaCompiler.Compile(System.Linq.Expressions.LambdaExpression)
0000008d71b7d520 00007ffb269f9ebb System.Linq.Expressions.LambdaExpression.Compile()
0000008d71b7d550 00007ffb2e6ebf20 Newtonsoft.Json.Utilities.ExpressionReflectionDelegateFactory.CreateDefaultConstructor[[System.__Canon, System.Private.CoreLib]](System.Type)
0000008d71b7d5c0 00007ffb2e6f6dc9 Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator(System.Type)
0000008d71b7d600 00007ffb2e6f6ee5 Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(Newtonsoft.Json.Serialization.JsonContract)
0000008d71b7d640 00007ffb2e6f77b5 Newtonsoft.Json.Serialization.DefaultContractResolver.CreateDictionaryContract(System.Type)
0000008d71b7d6a0 00007ffb2e6f7ec3 Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(System.Type)
0000008d71b7d6f0 00007ffb2e6f59b1 Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(System.Type)
0000008d71b7d780 00007ffb2e70575f Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(Newtonsoft.Json.JsonWriter, System.Object, System.Type)
0000008d71b7d7f0 00007ffb2e6d26b6 Newtonsoft.Json.JsonSerializer.SerializeInternal(Newtonsoft.Json.JsonWriter, System.Object, System.Type)
0000008d71b7d8a0 00007ffb2e71db9a Newtonsoft.Json.Linq.JToken.FromObjectInternal(System.Object, Newtonsoft.Json.JsonSerializer)
0000008d71b7d900 00007ffb2e717ef0 Newtonsoft.Json.Linq.JObject.FromObject(System.Object, Newtonsoft.Json.JsonSerializer)
0000008d71b7d950 00007ffb2e717eca Newtonsoft.Json.Linq.JObject.FromObject(System.Object)
0000008d71b7d980 00007ffb338f8a25 Microsoft.DotNet.Tools.Build.IncrementalCache.WriteToFile(System.String)
0000008d71b7d9e0 00007ffb338f97b5 Microsoft.DotNet.Tools.Build.IncrementalManager.CacheIncrementalState(Microsoft.DotNet.Tools.Build.ProjectGraphNode)
0000008d71b7da30 00007ffb338f8672 Microsoft.DotNet.Tools.Build.DotNetProjectBuilder.ProjectSkiped(Microsoft.DotNet.Tools.Build.ProjectGraphNode)
0000008d71b7da70 00007ffb338fb10c Microsoft.DotNet.Tools.Build.ProjectBuilder.CompileWithDependencies(Microsoft.DotNet.Tools.Build.ProjectGraphNode)
0000008d71b7dae0 00007ffb338fadd2 Microsoft.DotNet.Tools.Build.ProjectBuilder.Build(Microsoft.DotNet.Tools.Build.ProjectGraphNode)
0000008d71b7db60 00007ffb338f84d9 Microsoft.DotNet.Tools.Build.DotNetProjectBuilder.Build(Microsoft.DotNet.Tools.Build.ProjectGraphNode)
0000008d71b7dba0 00007ffb3390ef8a Microsoft.DotNet.Tools.Build.ProjectBuilder+d__3.MoveNext()
0000008d71b7dbf0 00007ffac4b8d93f System.Collections.Generic.EnumerableHelpers.ToArray[[Microsoft.DotNet.Tools.Build.CompilationResult, dotnet]](System.Collections.Generic.IEnumerable`1, Int32 ByRef)
0000008d71b7dc60 00007ffac4b8d7fa System.Linq.Enumerable.ToArray[[Microsoft.DotNet.Tools.Build.CompilationResult, dotnet]](System.Collections.Generic.IEnumerable`1)
0000008d71b7dca0 00007ffb338fa540 Microsoft.DotNet.Tools.Build.BuildCommand.OnExecute(System.Collections.Generic.IEnumerable`1, System.Collections.Generic.IEnumerable`1, Microsoft.DotNet.Tools.Compiler.BuildCommandApp)
0000008d71b7dd30 00007ffb33910585 Microsoft.DotNet.Tools.Compiler.BuildCommandApp+c__DisplayClass57_0.b__0()
0000008d71b7dd70 00007ffb33909c41 Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(System.String[])
0000008d71b7de20 00007ffb338fbdee Microsoft.DotNet.Tools.Compiler.BuildCommandApp.Execute(Microsoft.DotNet.Tools.Compiler.OnExecute, System.String[])
0000008d71b7de70 00007ffb338fa34f Microsoft.DotNet.Tools.Build.BuildCommand.Run(System.String[], Microsoft.DotNet.ProjectModel.BuildWorkspace)
0000008d71b7ded0 00007ffb338f1d04 Microsoft.DotNet.Tools.Run.RunCommand.RunExecutable()
0000008d71b7df70 00007ffb338f189f Microsoft.DotNet.Tools.Run.RunCommand.Start()
0000008d71b7dfa0 00007ffb3390da4b Microsoft.DotNet.Tools.Run.RunCommand+c__DisplayClass0_0.b__0()
0000008d71b7dfe0 00007ffb33909c41 Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(System.String[])
0000008d71b7e090 00007ffb338f17ad Microsoft.DotNet.Tools.Run.RunCommand.Run(System.String[])
0000008d71b7e110 00007ffb33907d89 Microsoft.DotNet.Cli.Program.ProcessArgs(System.String[], Microsoft.DotNet.Cli.ITelemetry)
0000008d71b7e1c0 00007ffb3390788a Microsoft.DotNet.Cli.Program.Main(System.String[])
0000008d71b7e428 00007ffb24537463 [GCFrame: 0000008d71b7e428] 
0000008d71b7e960 00007ffb24537463 [GCFrame: 0000008d71b7e960] 

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Approved for 1.1

The CoreCLR for UWP is update on a different schedule.