One of the most common debugging errors in my own development (Mac, iOS) is EXC_BAD_ACCESS. Despite its prevalence, its origin and exact meaning remain mysterious. Google lists a lot of mistakes, but the only explanation I could find is unofficial and incomplete.
I know that this exception (if this is the correct term for it) means that the code tried to access an address to which it does not have read and / or write permissions - a zero address, for example, or an address outside the process address space. But this is an intuitive interpretation based on my previous experience with virtual memory and protected memory systems. I have never seen the EXC_BAD_ACCESS documentation anywhere, and I'm really not sure who sends this exception to me - processor, Mac OS, UNIX, runtime, debugger? - so I donβt know with whom to ask (what is, what class of documentation to consult). I would like to know, for example, what βcodeβ means, which is indicated with an exception. Or another example: what other classes of similar exceptions (supposedly also marked as "EXC_") can also come from the same source?
Where can I find an explanation of EXC_BAD_ACCESS, its codes and general semantics, from an authoritative source? What is the authoritative source - who actually detects and throws an exception?
source share