具有核心图形功能的 iPad 设备上出现奇怪的崩溃

发布于 2024-08-28 18:22:09 字数 449 浏览 3 评论 0原文

我在 iPad 上遇到很多奇怪的 EXC_BAD_ACCESS 崩溃,这些崩溃只发生在设备上而不是模拟器中。我假设它们在某种程度上与记忆有关,但我不确定。它们都与图像上下文相关的函数一起发生。

一个奇怪的例子是使用 CGImageCreateWithImageInRect。例如,如果我运行一堆 UIImage 并使用 CGImageCreateWithImageInRect 裁剪它们,它总是会在特定的任意尺寸下崩溃。就像,如果我将它们全部裁剪为 200x200,它会在处理 12 个图像后崩溃。如果我将它们裁剪为 210x210,那就没问题了。

EXC_BAD_ACCESS 发生在从“CGBlt_copyBytes”调用的“memmove”内部。这就是调试器向我展示的所有奇怪的东西。我看不到我的任何方法的调用堆栈。

所有这些在模拟器中都运行良好!

我知道这一切都非常模糊,但如果有人有任何想法,他们将不胜感激。

I am getting a lot of strange EXC_BAD_ACCESS crashes on the iPad that only happen on the device and not in the simulator. I am assuming that they are somehow memory related, but I am not sure. They all happen with image context related functions.

One strange example is using CGImageCreateWithImageInRect. For example, if i run through a bunch of UIImages and crop them with CGImageCreateWithImageInRect, it will always crash at specific arbitrary sizes. Like, if I crop them all to 200x200, it crashes out after processing 12 images. If i crop them to 210x210, it works no problem.

The EXC_BAD_ACCESS happens inside of "memmove" called from "CGBlt_copyBytes". That is all the debugger shows me strangely enough. I can't see the callstack going up to any of my methods.

All of this works fine in the simulator!

I know this is all very vague, but if anyone has any ideas, they would be greatly appreciated.

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

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

发布评论

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

评论(1

十秒萌定你 2024-09-04 18:22:09

首先执行检查僵尸、运行 clang(构建和分析)等操作来查看是否存在内存管理问题。我认为您需要发布更多代码,因为这听起来确实像是内存踩踏。

Start by doing things like checking for zombies, and running clang (Build & Analyze) to see if you have memory management issues. I think you'll need to post more code, because this does sound like memory stomping.

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