Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXC_BAD_ACCESS > KERN_PROTECTION_FAILURE

Tags:

ios

iphone

My iPhone app crashed and I got the following stack trace from Crashlytics (iPhone 5C, iOS 7.1.1). It continues on for 500+ lines and I don't see anything that references my code anywhere. Is there any way I can debug this?

Crashed: com.apple.root.default-priority EXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x04fccfe0

  1. libsystem_c.dylib __vfprintf + 29
  2. libsystem_c.dylib __v2printf + 374
  3. libsystem_c.dylib __v2printf + 374
  4. libsystem_c.dylib _vsnprintf + 348
  5. libsystem_c.dylib vsnprintf + 72
  6. libsystem_c.dylib __snprintf_chk + 22
  7. Foundation _writeJSONNumber + 1040
  8. Foundation _writeJSONValue + 452
  9. Foundation ___writeJSONArray_block_invoke + 100
  10. CoreFoundation__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 90
  11. CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 232
  12. Foundation _writeJSONArray + 236
  13. Foundation _writeJSONValue + 504
  14. Foundation ___writeJSONArray_block_invoke + 100
  15. CoreFoundation __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 90
  16. CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 232
  17. Foundation _writeJSONArray + 236
  18. Foundation _writeJSONValue + 504
  19. Foundation ___writeJSONArray_block_invoke + 100
  20. CoreFoundation __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 90
  21. CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 232
  22. Foundation _writeJSONArray + 236
  23. Foundation _writeJSONValue + 504
  24. Foundation ___writeJSONArray_block_invoke + 100
  25. CoreFoundation __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 90
  26. CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 232

...

like image 599
Mark S. Avatar asked May 18 '14 02:05

Mark S.


People also ask

What is Exc_bad_access Kern_invalid_address?

Code Block. Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000. This indicates that your app crash because it tried to referenced NULL. Code Block.

What is Exc_breakpoint?

EXC_BREAKPOINT (SIGTRAP) and EXC_BAD_INSTRUCTION (SIGILL)The breakpoint exception type indicates a trace trap interrupted the process. A trace trap gives an attached debugger the chance to interrupt the process at a specific point in its execution. On ARM processors, this appears as EXC_BREAKPOINT (SIGTRAP).


1 Answers

This is a crash due to stack overflow, see the recurring sequences:

Foundation _writeJSONArray + 236
Foundation _writeJSONValue + 504
Foundation ___writeJSONArray_block_invoke + 100
CoreFoundation __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 90
CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 232

Looks like you are somewhere writing an array into a JSON structure and your code ends up in an endless loop.

Your own code isn't shown in the stack trace, since the stack trace got too large (stack overflow) and those frames got pushed out of the history.

like image 174
Kerni Avatar answered Sep 17 '22 15:09

Kerni