malloc:检测到堆损坏,空闲列表已损坏

时间:2019-09-13 10:59:33

标签: swift crash malloc ios13 heap-corruption

我的应用在iOS 12之前可以正常运行。将我的iOS版本更新为iOS 13 Beta后,该应用在随机位置崩溃,并出现相同的错误。以下是Xcode控制台。

MyApp(618,0x10cebd800) malloc: Heap corruption detected, free list is damaged at 0x28ea33ff0
*** Incorrect guard value: 5276115984
MyApp(618,0x10cebd800) malloc: *** set a breakpoint in malloc_error_break to debug

任何导致调试/解决的问题将不胜感激。预先感谢。

1 个答案:

答案 0 :(得分:0)

正如您所说,您的应用程序在随机位置崩溃,我还会添加随机时间,这可能是保留周期的明显迹象(可能是因为你忘记在你的代码中的某个地方捕获一个 weak self 在一个闭包中导致 heap 变得饱和。此时系统肯定会决定终止您的应用进程并为其他任务释放内存。

为了更清楚地看到这一点,请尝试使用 Leaks 分析模板分析您的应用程序(使用 Instruments 启动它),尝试使用该应用程序并尝试重现导致崩溃的场景,直到它停止(终止),此时 Instruments 将为您提供更多细节。