Understanding crashes Part 1

Why does my app crash?

AnkitaVK
2 min readJul 1, 2021
  • CPU can not execute your code.
  • Operating system terminates your app processes.
  • Programming language is preventing failure.
  • Developer is preventing failure.

How to access crash logs?

  • Crash log file is uploaded to the app store with users consent.
  • sign In to Xcode
  • upload app symbols (when necessary so that crash log becomes readable)
  • these crash log is then accessible from Xcode organizer
  • you can click 'Open in Project..' to see the crash in your code.

Analysing some of the crash logs

  • SIGILL : this indicates illegal instruction. CPU was trying to execute an instruction which is invalid or that does not exist. We get line and the file name.
    This is an example of 'Assertion and precondition' halt. Wherein your CPU halts the process when error occurs. Other examples are:
    — Out of bounds access(swift array)
    — Arithmetic overflow
    — Uncaught exception
    —custom assertions by developers
  • SIGIKILL : this is called when your OS stop your process. You also get to see reasons. The below example shows, your application take too long to process. This is an example of 'Watchdog event'.
    Other examples where OS can stop your app processes are:
    — Overheating of device
    — running out of memory
    — invalid code signature
    (check in Device window as they do not always appear in Xcode organiser)
  • SIGSEGV : this is a memory issue wherein your code is trying to access the memory which was deallocated.

reference:
https://developer.apple.com/videos/play/wwdc2018/414/

--

--