psutil: OSX: memory_maps() segfaults or raise EINVAL

I get Exception: OSError(22, ‘Invalid argument’) on OSX 10.13.4 with Python 2.7

Adding this to the loop makes it go away:

for proc in psutil.process_iter():
        if proc.pid == os.getpid(): continue   

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I have an example of how to iterate over the memory maps in Austin. It certainly isn’t documentation, but perhaps can be of help?

https://github.com/P403n1x87/austin/blob/master/src/mac/py_proc.h

It would be nice to have memory_maps back into psutil. I don’t have easy access to macOS so I can’t really try to do this myself at the moment, unfortunately.