OS: OS X 10.9.3
Python: 3.4.0
psutil: 2.1.1
Code: psutil.Process(target_pid).get_memory_maps()
I'm not quite sure why the code causes the target process to crash, it's rare on my laptop, impossible on a VM, but occurs often on other laptops.
Crash logs always indicate:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x.....
From what I can tell, the culprit is https://github.com/giampaolo/psutil/blob/master/psutil/_psutil_osx.c#L408
The next virtual memory region isn't necessarily a size offset from the current. The start of the next memory address can be page aligned.
Process: mds [62]
Path: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds
Identifier: mds
Version: 800.28
Code Type: X86-64 (Native)
Parent Process: launchd [1]
Responsible: mds [62]
User ID: 0
Date/Time: 2014-06-18 12:02:58.262 -0400
OS Version: Mac OS X 10.9.3 (13D65)
Report Version: 11
Anonymous UUID: 1660732C-C663-F139-B0C8-BDC5FC7D465F
Sleep/Wake UUID: 5E002B5D-86DB-4A1D-A353-E61483E5C138
Crashed Thread: 7 Dispatch queue: MDSImporter
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000104874000
VM Regions Near 0x104874000:
VM_ALLOCATE 000000010485b000-0000000104874000 [ 100K] rw-/rwx SM=ZER
-->
VM_ALLOCATE 0000000104875000-000000010487a000 [ 20K] rw-/rwx SM=ZER
Process: mds_stores [116]
Path: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds_stores
Identifier: mds_stores
Version: 800.28
Code Type: X86-64 (Native)
Parent Process: launchd [1]
Responsible: mds_stores [116]
User ID: 0
Date/Time: 2014-06-18 12:02:57.112 -0400
OS Version: Mac OS X 10.9.3 (13D65)
Report Version: 11
Anonymous UUID: 1660732C-C663-F139-B0C8-BDC5FC7D465F
Sleep/Wake UUID: 5E002B5D-86DB-4A1D-A353-E61483E5C138
Crashed Thread: 5 Dispatch queue: com.apple.metadata.spotlightindex
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000010674a6c0
VM Regions Near 0x10674a6c0:
MALLOC_LARGE 00000001066f9000-000000010674a000 [ 324K] rw-/rwx SM=ZER
-->
MALLOC_LARGE 000000010674b000-000000010677a000 [ 188K] rw-/rwx SM=ZER
OS: OS X 10.9.3
Python: 3.4.0
psutil: 2.1.1
Code: psutil.Process(target_pid).get_memory_maps()
I'm not quite sure why the code causes the target process to crash, it's rare on my laptop, impossible on a VM, but occurs often on other laptops.
Crash logs always indicate:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x.....
From what I can tell, the culprit is https://github.com/giampaolo/psutil/blob/master/psutil/_psutil_osx.c#L408
The next virtual memory region isn't necessarily a size offset from the current. The start of the next memory address can be page aligned.