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

psutil 2.1.0 network connection functions not working on Arch Linux #497

Closed
giampaolo opened this issue May 23, 2014 · 2 comments
Closed

Comments

@giampaolo
Copy link
Owner

From Alexande...@googlemail.com on April 17, 2014 13:48:53

Hello,

testing the new psutil.net_connections() function resultet in an error. Also 
the update from psutil 2.0.0 to 2.1.0 broke psutil.Process.connections() on my 
machine. What steps will reproduce the problem?  
# python
Python 3.4.0 (default, Mar 17 2014, 23:20:09)
[GCC 4.8.2 20140206 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.net_connections()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/psutil/__init__.py", line 1790, in 
net_connections
    return _psplatform.net_connections(kind)
  File "/usr/lib/python3.4/site-packages/psutil/_pslinux.py", line 572, in 
net_connections
    return _connections.retrieve(kind)
  File "/usr/lib/python3.4/site-packages/psutil/_pslinux.py", line 556, in retrieve
    for fd, family, type_, laddr, raddr, status, bound_pid in ls:
  File "/usr/lib/python3.4/site-packages/psutil/_pslinux.py", line 490, in 
process_inet
    raise ValueError("ambiguos inode with multiple "
ValueError: ambiguos inode with multiple PIDs references 

What is the expected output?  
A list of all existing socket connections. 

What do you see instead?  
An error (as posted above). 

What version of psutil are you using? What Python version?  
psutil 2.1.0, python 3.4 and python 2.7.6 

On what operating system? Is it 32bit or 64bit version?  
Arch Linux, 64bit 

Please provide any additional information below.  
According to the comment in line 486 - 488 in psutil/_pslinux.py you don't want 
to check for multiple inodes if it is a Unix Socket - but the check for type_ 
!= socket.AF_UNIX in the if-statement seems to be missing.
After patching the file (see attached diff) it seems to work as intended.

Kind regards,

Alexander Grothe

Attachment: psutil-2.1.0-_pslinux.diff

Original issue: http://code.google.com/p/psutil/issues/detail?id=497

@giampaolo
Copy link
Owner Author

From g.rodola on April 17, 2014 14:08:51

Thanks, fixed in revision 7ed2ca4ba90b . I will provide a release (reasonably) soon.

Status: FixedInHG
Labels: -Milestone-2.1.0 Milestone-2.1.1

@giampaolo
Copy link
Owner Author

From g.rodola on May 13, 2014 07:43:22

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant