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

IOError thrown by _pslinux #130

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

IOError thrown by _pslinux #130

giampaolo opened this issue May 23, 2014 · 7 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on November 03, 2010 22:50:47

What steps will reproduce the problem?  
1. this is hard to reproduce on demand, but it occurs regularly for me on a 
linux debian machine 

What is the expected output?  


What do you see instead?  
psutil docs say that it is to throw a psutil.NoSuchProcess error if it ever 
encounters such a situation; it is not expected to throw an IOError. 

What version of psutil are you using? What Python version?  
psutil 1.3.1; python 2.5 on linux 

On what operating system? Is it 32bit or 64bit version?  
Linux debian lenny 

Please provide any additional information below.  
The relevant traceback follows:
...
  File "/home/ldr/lib/python2.5/site-packages/psutil/_pslinux.py", line 108, in wrapper
    return method(self, pid, *args, **kwargs)
  File "/home/ldr/lib/python2.5/site-packages/psutil/_pslinux.py", line 123, in wrapper
    return callable(*args, **kwargs)
  File "/home/ldr/lib/python2.5/site-packages/psutil/_pslinux.py", line 166, in 
get_process_info
    return (pid, self._get_ppid(pid), name, path, cmdline,
  File "/home/ldr/lib/python2.5/site-packages/psutil/_pslinux.py", line 283, in _get_ppid
    for line in f:
IOError: [Errno 3] No such process
...


The issue seems to be an attempt to access a file in /proc that doesn't exist.

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

@giampaolo
Copy link
Owner Author

From g.rodola on November 03, 2010 15:14:53

Looks like you hit issue 12 , fixed in r135 (ENOENT gets translated in NSP 
exception).
What I can tell for sure is that this is fixed in the current trunk.
Thanks a lot for caring, btw.

Status: Duplicate
Mergedinto: 112

@giampaolo
Copy link
Owner Author

From [email protected] on November 23, 2010 09:17:36

I'd like to reopen this, I just received an IOerror  from psutil 0.2.0/python 
2.5 on Linux. Below is copy/paste of the relevant traceback:

  File 
"/srv/home/ldr/kline/local/lib/python2.5/site-packages/psutil/__init__.py", 
line 162, in name
    name = self._platform_impl.get_process_name()
  File 
"/srv/home/ldr/kline/local/lib/python2.5/site-packages/psutil/_pslinux.py", 
line 174, in wrapper
    return callable(self, *args, **kwargs)
  File 
"/srv/home/ldr/kline/local/lib/python2.5/site-packages/psutil/_pslinux.py", 
line 204, in get_process_name
    name = f.read().split(' ')[1].replace('(', '').replace(')', '')
IOError: [Errno 3] No such process

It looks like even though the process is attempting to read a file in /proc/, 
and just as you did, I'd expect a possible errno.ENOENT, the error is  
errno.ESRCH.

@giampaolo
Copy link
Owner Author

From g.rodola on November 23, 2010 09:33:12

Interesting. Didn't know it was possible but actually it makes sense.
ENOENT (no such file) can be raised on open() and ESRCH (no such process) on 
read() if file (aka process) is gone in meantime.

I'll make wrap_exception decorator treat this event as an alias for 
psutil.NoSuchProcess exception.

Status: ReOpened
Labels: OpSys-Linux Milestone-0.2.1
Mergedinto: -112

@giampaolo
Copy link
Owner Author

From g.rodola on November 23, 2010 09:43:57

Fixed in r842 .
Thanks.

Status: FixedInSVN

@giampaolo
Copy link
Owner Author

From [email protected] on November 23, 2010 10:58:32

Looks promising - I have not seen any new IOErrors with the latest svn code.

@giampaolo
Copy link
Owner Author

From g.rodola on March 20, 2011 14:55:37

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:56:32

Updated csets after the SVN -> Mercurial migration: r135 == revision 
5f1c9bf2dbe4 r842 == revision 7854a1d35b5f

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