malloc: *** 错误: 已释放对象的校验和不正确 - 对象可能在被释放后被修改 [英] malloc: *** error: incorrect checksum for freed object - object was probably modified after being freed

查看:20
本文介绍了malloc: *** 错误: 已释放对象的校验和不正确 - 对象可能在被释放后被修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 iOS 应用程序有一个大问题:它有时会在没有详细调试错误的情况下崩溃.堆栈跟踪为空.这些是堆栈跟踪中仅有的两行:

I have a big problem with my iOS App: it crashes sometimes without detailed debug error. The stack trace is empty. These are the only two lines in the stack trace:

  1. 在 UIApplicationMain 中的symbol stub for: -[_UIHostedTextServiceSessiondismissTextServiceAnimated:]"处开始崩溃.
  2. 并报告libsystem_c.dylib`malloc_error_break".

com.apple.main-thread中.

Xcode 调试器上的错误(连接设备):

The error on Xcode debugger (with connected device):

malloc: *** error for object 0x208a7614: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

我已经使用 libsystem_c.dylib 在 malloc_error_break 中设置了一个断点,而没有来自调试器的任何反馈.我不知道如何解决这个问题.

I have set a breakpoint in malloc_error_break with libsystem_c.dylib without any feedback from debugger. I have no idea to solve this issue.

推荐答案

要找到问题的根源,在 Xcode 中转到 Product > Scheme > Edit Scheme,然后在 Diagnostics 选项卡下启用所有 Malloc 设置和 Guard Malloc.

To find the source of the problem, in Xcode go to Product > Scheme > Edit Scheme, and under Diagnostics tab enable all the Malloc settings and Guard Malloc.

这样,再次运行您的应用程序,Xcode 将停在导致问题的行.

With that, run your application again, and Xcode will stop at the line causing the problem.

这篇关于malloc: *** 错误: 已释放对象的校验和不正确 - 对象可能在被释放后被修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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