Mark S.
Mark S.

Reputation: 4017

EXC_BAD_ACCESS > KERN_PROTECTION_FAILURE

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

...

Upvotes: 12

Views: 15185

Answers (1)

Kerni
Kerni

Reputation: 15339

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.

Upvotes: 7

Related Questions