iOS 应用程序在设备上崩溃且没有崩溃信息

发布于 2024-12-07 00:22:16 字数 201 浏览 0 评论 0原文

当我重复一系列特定的操作序列几次后,我的应用程序在设备上崩溃,通常它发生在触发内存级别1之后,并且总是在加载其中一个视图时发生。该问题无法在模拟器中重现。

每次执行时都会出现轻微的内存泄漏,但内存使用量相当低(如分配和泄漏中所示)。我已经删除了代码,但问题仍然存在。

问题正在调试问题,因为控制台中没有消息,也没有崩溃日志。

有什么建议吗?

My app is crashing on the device after I repeat a certain sequence of actions a few times, generally it occurs after a memory level of one is triggered, and always occurs when one of the view is being loaded. This problem cannot be reproduced in the Simulator.

There are minor memory leaks upon each execution, but memory usage is quite low (as shown in Allocations and Leaks). I have stripped down the code, but the problem persists.

The issue is debugging the problem as there is no message in the console and no crash log.

Any suggestions?

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

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

发布评论

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

评论(2

開玄 2024-12-14 00:22:16

此处讨论了搜索内存泄漏 - Xcode 中的内存泄漏检测工具

内存泄漏可能很难发现,因为它们可能会导致不可预测的影响。使用 xcode 中的 Leak 工具并检查您的代码。可能值得仔细阅读有关内存管理的编程指南,因为您可能会在不应该释放的时候释放某些内容(或者反之亦然)。问题不一定出在你想的地方。

我认为这将需要您仔细检查代码并检查所有内容,即使您认为某些东西按其应有的方式工作,也只需检查以确保 - 您可能会惊讶地发现事实并非如此。

Searching for memory leaks is discussed here - Memory leak detection tools in Xcode.

Memory leaks can be hard to find since they can cause unpredictable effects. Use the Leak tool in xcode and go through your code. It may be worth looking through the programming guide on memory management as you may be releasing something when you shouldn't be (or the other way around). The problem may not necessarily be where you think.

I think it's going to take you meticulously going through your code and checking everything, even if you think something is working the way it should be, just check to be sure - you may be surprised to find that it's not.

歌入人心 2024-12-14 00:22:16

OpenGL 可能会导致不明原因的崩溃。

我的 OpenGL 代码中有一个保留周期。

这发生在我的自定义 UIView 中,其中我有一个 GLKView 子视图。该子视图永远无法释放,从而导致崩溃。解决方案是使用 weak 而不是 strong

@property (strong, nonatomic) GLKView* glkView;   // Crash, no crash report, no errors
@property (weak,   nonatomic) GLKView* glkView;   // this works

日志中没有错误。没有崩溃报告。我启用了在抛出时中断的异常,但没有抛出异常。我已经在各处插入了 NSLog,但它没有显示任何有用的信息。我启用了僵尸,但没有注意到任何异常。

OpenGL can cause obscure crashes.

I had a retain cycle in my OpenGL code.

This happened in my custom UIView, where I had a GLKView subview. This subview could never be released, leading to a crash. Solution was to use weak instead of strong.

@property (strong, nonatomic) GLKView* glkView;   // Crash, no crash report, no errors
@property (weak,   nonatomic) GLKView* glkView;   // this works

There was no errors in the log. No crash report. I have exceptions enabled to break on throw, but no exceptions were thrown. I had inserted NSLog's everywhere, but it didn't reveal anything useful. I had zombies enabled, but didn't notice anything unusual.

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