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

问题描述 投票:0回答:1

我的应用程序在 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

任何调试/解决此问题的线索将不胜感激。预先感谢。

swift crash malloc ios13 heap-corruption
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.