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

Electron/Atom processes displayed wrong in process list #1192

Closed
towo opened this issue Nov 24, 2017 · 5 comments
Closed

Electron/Atom processes displayed wrong in process list #1192

towo opened this issue Nov 24, 2017 · 5 comments
Labels
Milestone

Comments

@towo
Copy link

towo commented Nov 24, 2017

Description

Process list shows a shortened/partial string for electron apps like Discord, and misidentifies the process name.

Actual ps output:

towo      9912  1.6  2.1 2345544 340136 tty2   Sl+  Nov23  18:17 /opt/discord/Discord --type=renderer --no-sandbox --primordial-pipe-token=<TOKEN REMOVED> --lang=en-GB --app-path=/opt/discord/resources/app.asar --node-integration=true --background-color=#282b30 --enable-blink-features=EnumerateDevices,AudioOutputDevices --hidden-page --enable-pinch --num-raster-threads=2 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553 --disable-accelerated-video-decode --service-request-channel-token=<TOKEN REMOVED> --renderer-client-id=6 --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd

What glances shows:

app.asar --node-integration=true --background-color=#282b30 --enable-blink-features=EnumerateDevices,AudioOutputDevices --hidden-page [...]

(The rest of the line is there, just not easily copypastable due to terminal size limits)

Similar things happen with spotify:

/opt/spotify/spotify --type=gpu-process --no-sandbox --lang=en-US --log-file=/opt/spotify/debug.log --log-severity=disable --product-version=Spotify/1.0.64.407 --supports-dual-gpus=false --gpu-driver-bug-workarounds=1,9,27,70,84 --disable-gl-extensions=GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent --disable-accelerated-video-decode --gpu-vendor-id=0x8086 --gpu-device-id=0x1616 --gpu-driver-vendor --gpu-driver-version --gpu-driver-date --lang=en-US --log-file=/opt/spotify/debug.log --log-severity=disable --product-version=Spotify/1.0.64.407 --service-request-channel-token=<TOKEN REMOVED>

vs. glances command column:

1.0.64.407 --service-request-channel-token=<TOKEN REMOVED>

The removed tokens are of course hex strings. Additionally, the whole command is highlighted green, like a process name.

Since the cut-off seems to be --app-path=/opt/discord/resources/ and --production-version=Spotify/ respectively, I'm guessing some sort of regular expression is being overzealous.

Versions

% glances -V
Glances v2.11.1 with psutil v5.4.1
% lsb-release -a
LSB Version:    1.4
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
@nicolargo nicolargo added the bug label Nov 25, 2017
@nicolargo nicolargo added this to the Glances 3.0 milestone Nov 25, 2017
@nicolargo
Copy link
Owner

Also reproduced with the atom editor processes...

@nicolargo
Copy link
Owner

nicolargo commented Nov 25, 2017

Corrected in the latest commit: c5253c3
Will be available in Glances 3.0.

@towo Thanks for the issue report !

@nicolargo nicolargo changed the title Electron processes displayed wrong in process list Electron/Atom processes displayed wrong in process list Nov 26, 2017
@nicolargo nicolargo reopened this Nov 26, 2017
@nicolargo
Copy link
Owner

I re-open it because the issue did not solve all the cases...

In fact the problem is in the cmdline() method of the Psutil Process class ==> giampaolo/psutil#1179 (comment)

I revert my commit.

@nicolargo
Copy link
Owner

Solved by a dirty workarround.
It will be removed when the PSutil bug will be solved.

Available on the DEVELOP branch.

Please test it ;)

@towo
Copy link
Author

towo commented Nov 26, 2017

Looks good 👍

nicolargo added a commit that referenced this issue May 26, 2018
…is now solved on PSUtil 5.4.2 and higher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants