-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet-trace needs to work better with apps that has the EventSourceSupport feature switched off #46047
Comments
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue DetailsDescriptionWhen an out of proc tracing tool like dotnet-trace is used to collect a trace from an application that has been built with the feature EventSourceSupport turned off, it crashes the application. Also the generated trace file (nettraace.trace) is corrupted. Repro steps
Expected Behaviordotnet-trace exits with a message indicating that EventSource is turned off Current Behavior`dotnet-trace collect -- test2.exe Provider Name Keywords Level Enabled By Process : D:\work\Core\Test\Dec_6\test2\bin\Debug\net5.0\win-x64\publish\test2.exe [00:00:00:01] Recording trace 0.00 (B) Trace completed.` Reading the generated trace file, nettrace.trace, shows the following stack trace ***** Consider using /ContinueOnError to ignore the bad part of the trace. *****
|
I'm not sure this is something we'll be able to observe external to the application without runtime changes. More likely I would expect dotnet-trace to receive 0 events and have an empty trace file. We could add a special event that gets sent in the event we find |
From a team discussion related to #43657 |
Attempting to repro this was not successful. I messaged @LakshanF, who could not repro it either. We are closing this issue. |
Description
When an out of proc tracing tool like dotnet-trace is used to collect a trace from an application that has been built with the feature EventSourceSupport turned off, it crashes the application. Also the generated trace file (nettraace.trace) is corrupted.
Repro steps
<EventSourceSupport>false</EventSourceSupport>
<TrimMode>link</TrimMode>
and<PublishTrimmed>true</PublishTrimmed>
Expected Behavior
dotnet-trace exits with a message indicating that EventSource is turned off
Current Behavior
`dotnet-trace collect -- test2.exe
No profile or providers specified, defaulting to trace profile 'cpu-sampling'
Provider Name Keywords Level Enabled By
Microsoft-DotNETCore-SampleProfiler 0x0000F00000000000 Informational(4) --profile
Microsoft-Windows-DotNETRuntime 0x00000014C14FCCBD Informational(4) --profile
Process : D:\work\Core\Test\Dec_6\test2\bin\Debug\net5.0\win-x64\publish\test2.exe
Output File : D:\work\Core\Test\Dec_6\test2\bin\Debug\net5.0\win-x64\publish\trace.nettrace
[00:00:00:01] Recording trace 0.00 (B)
Press or <Ctrl+C> to exit...
Trace completed.`
Reading the generated trace file, nettrace.trace, shows the following stack trace
***** Consider using /ContinueOnError to ignore the bad part of the trace. *****
Error: Exception EventPipe conversion: System.Exception: Read past end of stream.
at FastSerialization.IOStreamStreamReader.Fill(Int32 minimum)
at FastSerialization.MemoryStreamReader.ReadByte()
at FastSerialization.Deserializer.ReadObject()
at Microsoft.Diagnostics.Tracing.EventPipeEventSource.Process()
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CopyRawEvents(TraceEventDispatcher rawEvents, IStreamWriter writer)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.<>c__DisplayClass120_0.<FastSerialization.IFastSerializable.ToStream>b__0()
at FastSerialization.DeferedRegion.Write(Serializer serializer, Action toStream)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.FastSerialization.IFastSerializable.ToStream(Serializer serializer)
at FastSerialization.Serializer.WriteObjectData(IFastSerializable obj, Tags beginTag)
at FastSerialization.Serializer.WriteObjectRef(IFastSerializable obj, Boolean defered)
at FastSerialization.Serializer..ctor(IStreamWriter writer, IFastSerializable entryObject)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CreateFromEventPipeEventSources(TraceEventDispatcher source, String etlxFilePath, TraceLogOptions options)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CreateFromEventPipeDataFile(String filePath, String etlxFilePath, TraceLogOptions options)
at PerfView.EventPipePerfViewData.GetTraceLog(TextWriter log, Action`3 onLostEvents
The text was updated successfully, but these errors were encountered: