有序调用堆栈 - 使用 Instruments Time Profiler?

发布于 2024-12-10 13:47:35 字数 436 浏览 0 评论 0 原文

我正在尝试修复 iOS 应用程序中随机发生的崩溃(EXC_BAD_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS at 0xe104019e)。应用程序同时执行许多操作 - 使用 NSURLConnection 加载数据、重绘具有许多嵌套 UIView 的复杂布局、绘制 UIImage、在本地磁盘上缓存下载的文件、查找本地缓存中的文件可用性等。这些操作是分布式的进入多个线程,当崩溃发生时,我完全困惑之前的确切步骤。

我想使用一种方法来跟踪分配到线程中的发生顺序的调用堆栈,并查看崩溃前最后 1-5 毫秒内调用了哪些对象方法,然后我可以隔离产生崩溃的错误。

乍一看,Instruments 中的 Time Profiler 提供了这种包含许多细节的跟踪能力,但采样的调用堆栈似乎以随机顺序呈现 - 或者也许我弄错了......

是否有一种方法可以告诉我到底发生了什么按执行顺序 ?

I am trying to fix a randomly occurring crash in a iOS app (EXC_BAD_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS at 0xe104019e). The application performs many operations at the same time - loading data with NSURLConnection, redrawing a complex layout with many nested UIViews, drawing UIImages, caching downloaded files on the local disk, finding out files availability in local cache etc. etc. These operations are distributed into a number of threads and when the crash takes place I am totally confused what exact steps preceded it.

I would like to use a method to track the call stacks in the order of occurrence distributed into threads and see what objects methods were called during last 1-5ms before the crash, then I could isolate the bug that produces the crash.

At first sight the Time Profiler in Instruments offers this kind of tracking ability with many details but sampled call stacks seem to be presented in a random order - or maybe I get it wrong...

Is there a method that would tell me what exactly happens in the order of execution with ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

殊姿 2024-12-17 13:47:35

1)启用僵尸运行,并删除所有编译器和静态分析器警告。

2)这可能是一个线程问题,您没有适当地保护共享数据。

Instruments 在线程排序/过滤方面非常强大,但没有确切的模板来满足您想要完成的任务。

如果您可以将问题减少到一个小的对象类型集合,那么如果您添加分配工具并启用引用计数记录,则可以根据引用计数跟踪执行。

1) Run with zombies enabled, and removed all compiler and static analyzer warnings.

2) It is likely a threading issue, where you are not protecting your shared data appropriately.

Instruments is quite powerful regarding thread sorting/filtering, but there is no exact template for what you are trying to accomplish.

If you can reduce the problem to a small collection of object types, then you can follow execution based on the reference counts if you add the allocations instrument and enable reference count recording.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文