Skip to content
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: Error in speedscope.app showing with Failed to load format Error: Tried to leave frame #1206

Closed
mcraiha opened this issue Jun 6, 2020 · 8 comments · Fixed by #1313
Assignees
Milestone

Comments

@mcraiha
Copy link

mcraiha commented Jun 6, 2020

I tried to use dotnet-trace with WSL Ubuntu 18.04 and .NET Core 3.1.300 in my project. I have chosen speedscope output, and I do get trace.speedscope.json file, but it does not open in https://www.speedscope.app/ and browser's Javascript console gives following error:

Failed to load format Error: Tried to leave frame "System.Console!System.ConsolePal.Write(class Microsoft.Win32.SafeHandles.SafeFileHandle,unsigned int8*,int32,bool)" while frame "System.Console!System.ConsolePal.Read(class Microsoft.Win32.SafeHandles.SafeFileHandle,unsigned int8[],int32,int32)" was at the top at 5.2182000003814695
at n._leaveFrame (speedscope.ca4dd7be.js:156)
at n.leaveFrame (speedscope.ca4dd7be.js:156)
at speedscope.ca4dd7be.js:162
at a (speedscope.ca4dd7be.js:162)
at speedscope.ca4dd7be.js:162
at Array.map ()
at s (speedscope.ca4dd7be.js:162)
at import.67a00871.js:111
at Generator.next ()
at s (import.67a00871.js:111)

How to replicate:

  1. Clone https://github.com/mcraiha/CSharp-ChaCha20-NetStandard
  2. Move to harness folder
  3. Start harness with command dotnet run -c release < /dev/zero > /dev/null
  4. Get the ID of harness with following command dotnet-trace ps
  5. Start trace with following command dotnet-trace collect --process-id PID_HERE --format speedscope
  6. Stop tracing with enter after about 7 seconds
  7. Try to open the trace.speedscope.json in https://www.speedscope.app/

Speedscope tracing works OK in another project of mine

@tommcdon
Copy link
Member

tommcdon commented Jun 9, 2020

@josalem

@tommcdon tommcdon added this to Needs Triage in .NET Core Diagnostics via automation Jun 9, 2020
@tommcdon tommcdon added this to the 5.0 milestone Jun 9, 2020
@josalem
Copy link
Contributor

josalem commented Jun 17, 2020

Looks like this is an error caused by a recent change in Speedscope (jlfwong/speedscope#273) that decided to change behavior and fail hard on some ordering constraints. I'll take a look at our logic for conversion over in Microsoft/PerfView and see if I can figure out what causes the ordering issue.

CC @adamsitnik

@josalem
Copy link
Contributor

josalem commented Jun 17, 2020

Issue in Microsoft/PerfView: microsoft/perfview#1178.

Based on the comments here, it looks like we should be able to fix this by picking up the newest TraceEvent version.

@adamsitnik
Copy link
Member

I've provided a fix microsoft/perfview#1212

@athoscouto
Copy link

Thanks for fixing it!

Is there any schedule for a release that would include this patch?

@Oshirowanen
Copy link

I've provided a fix microsoft/perfview#1212

Thank you for fixing the problem. However, how do I make use of the fix as I am still getting the error? More details of the error here: https://stackoverflow.com/questions/63020262/why-does-tracing-c-sharp-code-in-linux-fail-when-imported-into-speedscope

@josalem
Copy link
Contributor

josalem commented Jul 27, 2020

I believe this fix is in the most recent release: https://github.com/dotnet/diagnostics/releases/tag/3.1.137102

@athoscouto
Copy link

Yes, it works! 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging a pull request may close this issue.

6 participants