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

Symbols aren't loaded sometimes #17

Open
macaba opened this issue Nov 30, 2024 · 12 comments
Open

Symbols aren't loaded sometimes #17

macaba opened this issue Nov 30, 2024 · 12 comments
Labels
question Further information is requested

Comments

@macaba
Copy link

macaba commented Nov 30, 2024

As per title - symbols aren't loaded sometimes (making a typical ~1000KB json.gz file into a ~160KB file that isn't very useful in the viewer).

I tried various things, such as rebuilding the application-to-be-profiled, deleting the symbol cache folder that I could find (in appdata). The only thing that made it work again is restarting my PC. Perhaps #13 had a similar resolution.

I noticed that after the restart, ultra showed many more symbols loaded, perhaps there could be a flag to not use the cached symbols?

@xoofx xoofx added the question Further information is requested label Nov 30, 2024
@xoofx
Copy link
Owner

xoofx commented Nov 30, 2024

Thanks for the report. I can't tell exactly what happens here, as I haven't experienced this myself yet.

I noticed that after the restart, ultra showed many more symbols loaded, perhaps there could be a flag to not use the cached symbols?

Caching is supposed to work mostly for symbols that are downloaded on internet. Disabling it would cause massive slowdown when resolving symbols.

Symbols aren't loaded sometimes

Could you elaborate exactly which symbols? Which assemblies/native DLLs are actually concerned? Is it user code (your assemblies), NuGet assemblies, OS DLLs? Anything that could help narrow down the issue.

There is a possibility to output what is happening in the symbol resolver, it's verbose so I haven't added it by default, but I could add a mode to store the log on disk to investigate such issues.

@xoofx
Copy link
Owner

xoofx commented Nov 30, 2024

Also, is it when you are profiling an app directly launched via ultra or a long running process?

@macaba
Copy link
Author

macaba commented Nov 30, 2024

There isn't a log file so I don't know exactly what symbols aren't loaded. The profiler view is really minimal, only showing memory allocations, so perhaps I could say "all of them".
Would this be obvious from the json files? I can email those over.

I am profiling an app directly launched, i.e. ultra.exe profile -- TS.NET.Engine.exe -seconds 10

@xoofx
Copy link
Owner

xoofx commented Nov 30, 2024

There isn't a log file so I don't know exactly what symbols aren't loaded. The profiler view is really minimal, only showing memory allocations, so perhaps I could say "all of them".
Would this be obvious from the json files? I can email those over.

The JSON won't help. The log file doesn't exist today because as I said, I don't write it for symbols 🙂
At least you should have native callstacks (kernel functions called...etc.)

I am profiling an app directly launched, i.e. ultra.exe profile -- TS.NET.Engine.exe -seconds 10

Whenever I test ultra, I'm testing it against https://github.com/xoofx/ultra/tree/main/src/Ultra.Example which works. Could you try it on your machine?

What is different with this TS.NET.Engine.exe? What is the .NET/OS version?

@macaba
Copy link
Author

macaba commented Nov 30, 2024

I have found steps to reproduce:

  • Run ultra to normal completion (JSON has all the data)
  • Run ultra, use CTRL+C to stop it early (JSON is missing data <-- to be expected?)
  • Run ultra to normal completion (JSON is missing data <-- the issue)
  • Restart PC
  • Run ultra to normal completion (JSON has all the data)

TS.NET.Engine is a console app, source

@macaba
Copy link
Author

macaba commented Nov 30, 2024

.NET 9, Windows 10.

@macaba
Copy link
Author

macaba commented Nov 30, 2024

I tried Ultra.Example on both .NET 8 and .NET 9, and my steps to reproduce did not work. I am out of ideas for now.

@xoofx
Copy link
Owner

xoofx commented Dec 1, 2024

Run ultra, use CTRL+C to stop it early (JSON is missing data <-- to be expected?)

This is not expected. Are you hitting CTRL+C more than one time?
you can pass --verbose to ultra e.g. ultra --verbose profile ... to get more details and can post them here.

TS.NET.Engine is a console app, source

Cool, I can try from there directly, let's see

@xoofx
Copy link
Owner

xoofx commented Dec 1, 2024

TS.NET.Engine is a console app, source

Running with TS.NET.Engine.exe -seconds 10 and it says:

Another instance of TS.NET.Engine is already running.

@macaba
Copy link
Author

macaba commented Dec 1, 2024

Open up thunderscope.yaml and change line 32 to HardwareDriver: Simulator

@macaba
Copy link
Author

macaba commented Dec 1, 2024

A new day allowed me to look at this with fresh critical eyes: I realized my muscle memory was opening an Administrator PowerShell prompt, not an Administrator Command prompt.

I found that CTRL+C in CMD is fine, and continues working.
Then I did CTRL+C in PS and it causes failure from that point on (and even when opening a new PS or CMD after that point, it's still broken).

@xoofx
Copy link
Owner

xoofx commented Dec 1, 2024

I found that CTRL+C in CMD is fine, and continues working.
Then I did CTRL+C in PS and it causes failure from that point on (and even when opening a new PS or CMD after that point, it's still broken).

When you say PS, is it pwsh (the .NET core version) or the old PS Windows?

I'm only running from pwsh and CTRL+C is working fine there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants