mach_inject
mach_inject copied to clipboard
mach_inject crashes target in OSX 10.12 (Sierra), unless if launched through Xcode
Is this working for everyone else in 10.12/Sierra?
I have an odd situation where mach_inject works perfectly fine, when my app is launched through Xcode. If I launch my app directly, the target process crashes as soon as it attempts to inject:
Date/Time: 2016-09-21 22:55:58.682 +0100
OS Version: Mac OS X 10.12 (16A323)
Report Version: 12
Anonymous UUID: 8AD07C6C-3EFE-5D39-B58B-393D95473947
Time Awake Since Boot: 3400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000e50d34ab
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
External Modification Warnings:
Thread creation by external task.
VM Regions Near 0xe50d34ab:
Stack 00000000bf800000-00000000c0000000 [ 8192K] rw-/rwx SM=PRV
-->
Submap 00000000ffff0000-00000000ffff1000 [ 4K] r--/r-- SM=PRV process-only VM submap
Does anyone have any ideas on how to tackle this?
Please don't file a bug report stating mach_inject is crashing for you when you try to use it -- you have to be hard-core enough to debug the problem yourself.
But anyway, it would be nice if you provide a simple demo project to reproduce the crash. Thanks
I get the same crash since Sierra. I'm using mach_inject in my application www.interface-inspector.com Interesting is the message "Thread creation by external task.". I don't get crashes anymore after I disabled SIP.
did you try codesigning your application and bundle which is getting injected?