Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 548e6d8

Browse files
committed
[Mac] Fix binding for task_info
It seems that the API requires the count in natural_t units, not in bytes. Fixing this, fixes the crasher in Catalina the reason it crashes in Catalina is that in Catalina task_info tries to write more data to the output struct (for Mojave the size of the struct and the maximum size written by Mojave was the same, so it didn't matter that the size argument was too big, because Mojave would never write more than the size of the buffer anyway) Thanks to @rolfbjarne for the investigative work
1 parent c740bfa commit 548e6d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/src/addins/MacPlatform/KernelInterop.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ static bool TryGetTaskVMInfo (out task_vm_info vm_info)
7676
vm_info = new task_vm_info ();
7777
int size;
7878
unsafe {
79-
size = sizeof (task_vm_info);
79+
// task_vm_info is the size in natural_t units
80+
size = sizeof (task_vm_info) / 4;
8081
}
8182

8283
int ret = task_info (mach_task_self (), TASK_VM_INFO, ref vm_info, ref size);

0 commit comments

Comments
 (0)