EXC_BAD_ACCESS在哪里记录? [英] Where is EXC_BAD_ACCESS documented?

查看:152
本文介绍了EXC_BAD_ACCESS在哪里记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我自己的开发(Mac,iOS)中更常见的调试错误之一是EXC_BAD_ACCESS。尽管它的共同点,它的起源和精确的含义仍然是神秘的。 Google列出了许多错误,但是我发现唯一的说明是非正式的和不完整的。

One of the more commonplace debugging errors in my own development (Mac, iOS) is EXC_BAD_ACCESS. Despite its commonness, its origin and precise meaning remain mysterious. Google lists many occurrences of the error, but the only explanation I could find is informal and incomplete.

我知道这个异常(如果这是正确的术语)意味着代码尝试访问它没有读取和/或写入的地址权限,例如空地址,或进程地址空间之外的地址。但这是一个直观的解释,基于我以前的虚拟内存和受保护的内存系统的经验。我从来没有看到EXC_BAD_ACCESS记录在任何地方,实际上我不知道谁正在向我发送这个异常 - CPU,Mac OS,UNIX,运行时,调试器? - 我不知道谁要问(那个是什么类型的文档要咨询)。我想知道,例如,异常列出的代码是什么意思。或另一个例子:什么其他类的类似异常(大概也标记为EXC_)也可能来自相同的来源?

I know that this exception (if that's the proper term for it) means that the code has attempted to access an address to which it does not have read and/or write privileges—the null address, for example, or an address outside of the process's address space. But this is an intuitive interpretation based on my prior experience with virtual memory and protected memory systems. I have never seen EXC_BAD_ACCESS documented anywhere, and indeed I'm not sure "who" is sending me this exception—the CPU, Mac OS, UNIX, the runtime, the debugger?—so I don't know who to ask (that is, what class of documentation to consult). I would like to know, for example, what the "code" that is listed with the exception means. Or another example: what other classes of similar exceptions (presumably also tagged with "EXC_") might also come from the same source?

在哪里可以找到EXC_BAD_ACCESS的解释,其代码和一般语义,从权威来源?什么是权威来源 - 谁正在检测和抛出异常?

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 is actually detecting and throwing the exception?

推荐答案

唯一的官员EXC_BAD_ACCESS可以找到的文档是技术问答,名为在Cocoa项目中查找EXC_BAD_ACCESS错误。它已经过时,只能证实你已经知道的:

The only official documentation I've been able to find for EXC_BAD_ACCESS is a Technical Q&A called Finding EXC_BAD_ACCESS bugs in a Cocoa project. It's dated and only confirms what you already know:


这种问题通常是过度释放对象的结果。这可能是非常混乱的,因为在发生错误后,故障往往会发生得很好。当程序深入框架代码时,崩溃也可能发生,通常没有你自己的代码在堆栈中可见。

This kind of problem is usually the result of over-releasing an object. It can be very confusing, since the failure tends to occur well after the mistake is made. The crash can also occur while the program is deep in framework code, often with none of your own code visible in the stack.

,它可以非常混乱。至少苹果肯定很多。 :)

Indeed, it can be very confusing. At least Apple acknowledges that much. :)

这篇关于EXC_BAD_ACCESS在哪里记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆