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

Crash while unpacking tuple for process listing #632

Closed
languitar opened this issue Jun 16, 2015 · 7 comments
Closed

Crash while unpacking tuple for process listing #632

languitar opened this issue Jun 16, 2015 · 7 comments
Labels

Comments

@languitar
Copy link

I am experiencing this error on a single host:

  File "build/bdist.linux-x86_64/egg/rsbhostmonitor/__init__.py", line 195, in _provide_connection_infos
    for connection in psutil.net_connections(kind=kind):
  File "/vol/csra/releases/trusty/lsp-csra-nightly/lib/python2.7/site-packages/psutil-2.2.1-py2.7-linux-x86_64.egg/psutil/__init__.py", line 1816, in net_connections
    return _psplatform.net_connections(kind)
  File "/vol/csra/releases/trusty/lsp-csra-nightly/lib/python2.7/site-packages/psutil-2.2.1-py2.7-linux-x86_64.egg/psutil/_pslinux.py", line 530, in net_connections
    return _connections.retrieve(kind)
  File "/vol/csra/releases/trusty/lsp-csra-nightly/lib/python2.7/site-packages/psutil-2.2.1-py2.7-linux-x86_64.egg/psutil/_pslinux.py", line 514, in retrieve
    for fd, family, type_, laddr, raddr, status, bound_pid in ls:
  File "/vol/csra/releases/trusty/lsp-csra-nightly/lib/python2.7/site-packages/psutil-2.2.1-py2.7-linux-x86_64.egg/psutil/_pslinux.py", line 475, in process_unix
    _, _, _, _, type_, _, inode = tokens[0:7]
ValueError: need more than 1 value to unpack

This occurs when using kind='all' and I could pin down that this is related to parsing code for unix domain sockets.

@languitar
Copy link
Author

There seems to be garbage in the /proc/net/unix file. I suspect this is a kernel bug, but handling this more gracefully would be nice.

@giampaolo
Copy link
Owner

Can you cat /proc/net/unix and paste it here?

@languitar
Copy link
Author

Unfortunately this was in a VNC session without clipbaord support. I only have a screenshot.

proc-net-unix-error-gig

@giampaolo
Copy link
Owner

Mmm, that's definitively a lot of garbage. It's hard to figure out how to turn that into a more graceful error message though.

@languitar
Copy link
Author

I would either expect that unreadable lines are completely ignored or that there is a dedicated exception explicitly explaining what is wrong. Something like: Error parsing file /proc/net/unix in line XXX. This would have helped to pin down this issues much better.

@giampaolo
Copy link
Owner

OK, I committed a change which raises RuntimeError including the offending file and line. I don't think this should pass ignored so let's just stick with a better error message.

@languitar
Copy link
Author

Great, thanks.

@giampaolo giampaolo added the bug label Nov 18, 2020
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