5 ms·
What does it look like when it crashes on iOS? Does just the app crash, springboard crashes or the device restarts?
by zuck9 12y ago
What does it look like when it crashes on iOS? Does just the app crash, springboard crashes or the device restarts?
- ttflee 12y agoJust 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.
- LeoNatan25 12y agoIt is supported, just need an expanded SDK or you can provide the OS X variant of mach_vm.h and import that.
- ttflee 12y agoBut clang did not treat it as an error when I commented the #include line. I have no idea if it was actually dynamically linked.
- _wmd 12y agoIncludes 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.
- ttflee 12y agoI 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.
- oleavr 12y agoThe 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.
- oleavr 12y agoThe screen turns blue – yes, blue, not joking – for a brief moment, and the system reboots. :)
- ttflee 12y agoIs it 64-bit only? Which hardware are you using for this test? EDIT: I cannot reproduce on iPhone 5 which is NOT running any 64-bit kernel.
- oleavr 12y agoI only tested it on 64-bit systems, where it triggers the kernel panic from both 32- and 64-bit processes (i386, x86_64, arm, and arm64). Hardware-wise it crashes every single device I've tried (MacBook Pro, iMac, iPhone 6, etc.), so this is not tied to any specific hardware.
- oleavr 12y agoAha, interesting. Does the program crash or exit gracefully?
- cfrs 12y agoIt does not crashes iOS 8.3.
- oleavr 12y agoInteresting, that's potentially very good news! To be sure, could you try again with the latest code snippet? I forgot to remove the VM_PROT_EXECUTE flag for non-jailbroken devices.
- cfrs 12y agoNo kernel panic, EXC_BAD_ACCESS in Debug/Release confs. Possibly I have provided wrong prototypes, mach_vm is n/a in iOS: https://gist.github.com/cfr/425812debdb2a6d0449f https://gist.github.com/cfr/425812debdb2a6d0449f
- oleavr 12y agoWhere does it crash? Try bumping the argument on line 21 – if you're unlucky library at index 1 contains mach_vm_read_overwrite and is suddenly no longer executable (since we change its second memory page from R-X to RW- due to stock kernels not allowing RWX pages).
- deleted 12y ago