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
- ref #1181, #1209, #1291 — committed to giampaolo/psutil by giampaolo 6 years ago
- OSX - wrapper around task_for_pid() (#1296) (OSX) wrapper around task_for_pid() fix #1181, fix #1209, fix #1291 — committed to giampaolo/psutil by giampaolo 6 years ago
- #1291 / OSX: mark memory_maps() as deprecated and make it alwats raise AccessDenied — committed to giampaolo/psutil by giampaolo 5 years ago
- #1291: (BACKWARD-INCOMPATIBLE) remove memory_maps() on OSX — committed to giampaolo/psutil by giampaolo 5 years ago
- Restrict psutil version during tests xref: https://github.com/giampaolo/psutil/issues/1291#issuecomment-468475756 — committed to regro-cf-autotick-bot/pycryptodomex-feedstock by nehaljwani 5 years ago
- Use vmmap for reading memory maps on macOS Call to .memory_maps() fails on Azure pipelines with: Traceback (most recent call last): ... return cext.proc_memory_maps(self.pid) ... — committed to regro-cf-autotick-bot/pycryptodomex-feedstock by nehaljwani 5 years ago
- Use vmmap for reading memory maps on macOS Call to .memory_maps() fails on Azure pipelines with: Traceback (most recent call last): ... return cext.proc_memory_maps(self.pid) ... — committed to regro-cf-autotick-bot/pycryptodomex-feedstock by nehaljwani 5 years ago
- Merge remote-tracking branch 'origin/master' into pslisten * origin/master: (150 commits) Linux / CPU freq, fixes #1481 improve pmap.py script reuse ps.py script in psutil.test() move get_ter... — committed to nlevitt/psutil by nlevitt 5 years ago
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.