Re:DIY: kernel panic OS X and iOS in 10 LOC
by ttflee on Saturday February 21, 2015 @06:26AM
(#9085306)
Just tried with iOS 8.1 SDK. It seems that <mach/mach_vm.h> is not supported on iOS. So far, I failed to reproduce the crash/kernel panic with code snippet from the original post.
[ Parent
| on HN ]
Re:DIY: kernel panic OS X and iOS in 10 LOC
by oleavr on Saturday February 21, 2015 @09:15AM
(#9085552)
The mach_vm.h header has been replaced with a dummy version in recent iOS SDKs, so you’ll have to copy it from your OS X SDK and adjust the include. Just updated the post, and also removed VM_PROT_EXECUTE from the mach_vm_protect call for compatibility with non-jailbroken devices.
Re:DIY: kernel panic OS X and iOS in 10 LOC
by LeoNatan25 on Saturday February 21, 2015 @07:47AM
(#9085397)
It is supported, just need an expanded SDK or you can provide the OS X variant of mach_vm.h and import that.
Re:DIY: kernel panic OS X and iOS in 10 LOC
by ttflee on Saturday February 21, 2015 @07:56AM
(#9085406)
But clang did not treat it as an error when I commented the #include line. I have no idea if it was actually dynamically linked.
Re:DIY: kernel panic OS X and iOS in 10 LOC
by _wmd on Saturday February 21, 2015 @08:31AM
(#9085451)
Includes don't control linking, and traditional C did not require function prototypes, so most compilers (in non-C++ mode at least) will happily compile calls to unknown functions, it just assumes a default signature.
Re:DIY: kernel panic OS X and iOS in 10 LOC
by ttflee on Saturday February 21, 2015 @09:47AM
(#9085638)
I know that and mach_* are supposed to be dynamically loaded. But what I failed to get is to reproduce the kernel panic, not to build and run on my iPhone 5. By now that piece of code could run but only result in normal crash, not kernel panic.