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

System.Diagnostics.Process.GetProcesses and System.Diagnostics.ProcessModule #8729

Closed
diamondes3 opened this issue Aug 11, 2017 · 3 comments
Closed

Comments

@diamondes3
Copy link

I'm creating a program that needs to get a list of currently executing processes in memory and take action to kill a given process, if it's a different instance of the same (currently executing program) that has become hung for some reason; where I have a criteria based on start time to declare a given process as being hung. This logic is being developed on a windows machine using "dotnet" core, then packaged and run on a Ubuntu machine.

If I get a list of processes via "Process.GetProcesses", I can see my currently executing logic in the list as "dotnet". This isn't real helpful, as what if there are X different "dotnet" programs running on this machine, they all look like they are the same logic due to the "dotnet" name. Some of them MIGHT be hung instances of the logic I'm after, some of them MIGHT be totally other "dotnet" assemblies.

I figured out, that if I examine the list of modules for a given process (ProcessModule), the ProcessModule.ModuleName is the name of the underlying .dll that the "dotnet" core environment is running.

This works fine on the Windows machine running Visual Studio. When I compile and package the logic and run it on the Linux machine, I get can get the list of Processes, examine their corresponding modules; however, the underlying .dll that the "dotnet" core is executing is missing from the list of modules that should be in that given process. In other words, the .dll name shows up as a module in the Windows process, but does NOT show up as a module in the Linux process; even though numerous other modules DO show up in the Linux environment for the given process.

There are no exceptions or any other errors that I'm seeing, just not seeing the underlying .dll listed as a module for a given process on the Linux machine.

Any constructive thoughts on this?

@benaadams
Copy link
Member

@diamondes3
Copy link
Author

diamondes3 commented Aug 11, 2017 via email

@jkotas
Copy link
Member

jkotas commented Dec 2, 2017

This issue was moved to dotnet/corefx#25652

@jkotas jkotas closed this as completed Dec 2, 2017
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 21, 2020
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

3 participants