-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Process.name() is incorrect with Chromium process on Linux #742
Comments
That is not a bug, that's the original information as it appears in /proc/pid/stat and I see no reason to truncate it. AFAIU this is a "frontend" / presentation end-user issue. If you (or glances in this case) want to truncate the process name for visualization purposes then just do it: |
Mhh /proc/[pid]/stat contains |
I did a bit of digging and it appears the root cause is that command line parameters are not always NUL separated in In my case on Ubuntu, the |
Can you please paste the content "/proc/{pid}/cmdline" and "/proc/{pid}/stat" and do that in python, like this?
|
|
IMHO this shouldn't be fixed. I think the user expectation is that cmdline contains the argv the program was started with. If a program modifies that memory so the information is lost, psutil shouldn't guess but return the data as acurately as possible. Chromium modifies argv[0] on purpose to make something else show up there: https://code.google.com/p/chromium/codesearch#chromium/src/content/common/set_process_title.cc&l=39 |
As an example for another tools that does that look at readproctitle from DJB's daemontools: https://cr.yp.to/daemontools/readproctitle.html
Admittedly, it doesn't change argv[0] but it's the same principle. |
@fbenkstein I think @desbma is complaining about |
Here is what I propose:
|
(Not sure if this is already mentioned in other issues or documents, but I don't find any in my brief search.) The I originally expected psutil could report the full name of a process (not the truncated version), but it seems I was wrong. I think this is a similar issue to the chromium one (because solving this requires the same method to solve the chromium issue) so post it here. |
psutil already tries to get the full |
Lines 653 to 666 in 65cc00e
|
FWIW, my htop does not recognize the chromium basename, which I can tell because I configure it to highlight the basename, and it gets that wrong for chromium and seemingly nothing else. |
On Linux, starting the Chromium browser starts several child processes with various command line parameters.
For these processes I get for example:
I expect:
Thanks
The text was updated successfully, but these errors were encountered: