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

Runtime thread names #34276

Closed
macaba opened this issue Mar 30, 2020 · 8 comments
Closed

Runtime thread names #34276

macaba opened this issue Mar 30, 2020 · 8 comments

Comments

@macaba
Copy link

macaba commented Mar 30, 2020

Running an application on Ubuntu 18.04.4 LTS under .NET 5 Preview 1 using Server GC, then running htop and enabling custom thread names gives me this view:

putty_2020-03-29_19-22-21

Most of the threads make sense to me, but there seems to be 7 unnamed threads (GeoVR.RangingSe) some of which I suspect are GC threads.

It would be beneficial if the runtime named these threads.

I would be willing to attempt a pull request but I have no runtime development experience so any hints to where I should be looking in the codebase would be most appreciated.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 30, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

@jkotas
Copy link
Member

jkotas commented Mar 30, 2020

Related dotnet/coreclr#27182

@macaba
Copy link
Author

macaba commented Mar 31, 2020

The plot thickens; on a different service that I just moved to .NET 5, there are threads named .NET Background and .NET Server GC and still 7 unnamed threads, so that would seem to eliminate the server GC as being the source of the unnamed threads. All but 1 of these unnamed threads have used 0 CPU time.

@stephentoub
Copy link
Member

so any hints to where I should be looking in the codebase would be most appreciated.

Can you attach a debugger/grab a dump and look at the call stacks of those threads?

@macaba
Copy link
Author

macaba commented Apr 1, 2020

I was able to attach a debugger over SSH.

First observation: The 'threads' view in Visual Studio shows more unnamed threads that are actually named in htop (like .NET ThreadPool).

So I moved over to dotnet-dump and was able to analyze. I'm new to dotnet-dump but I was able to ascertain that all the unnamed threads are unmanaged threads. Is there a sequence of commands for showing more information about unmanaged threads?

@hoyosjs
Copy link
Member

hoyosjs commented Apr 2, 2020

@macaba not on dotnet-dump. All it can do relates to managed code. The best idea here is to use a native debugger. lldb is usually what we recommend as it can skip over managed frames and if needed you can use SOS commands.

@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Apr 10, 2020
@mangod9 mangod9 added this to the Future milestone Apr 10, 2020
Copy link
Contributor

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Oct 11, 2024
Copy link
Contributor

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@dotnet-policy-service dotnet-policy-service bot removed this from the Future milestone Oct 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2024
@dotnet-policy-service dotnet-policy-service bot removed no-recent-activity backlog-cleanup-candidate An inactive issue that has been marked for automated closure. labels Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants