Tapas Pal
Tapas Pal

Reputation: 7207

malloc: Heap corruption detected, free list is damaged

My app is running fine till iOS 12. After updating my iOS version to iOS 13 beta, the app is crashing in random places and with the same error. Following is the Xcode console.

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

Any lead to debug/solve this will be appreciated. Thanks in advance.

Upvotes: 3

Views: 12251

Answers (1)

Malloc
Malloc

Reputation: 16286

As you stated, your app crashes in random places, I would also add in random times, this might be a clear sign of a retain cycle (could be because you forgot to capture a weak self inside a closure) somewhere in your code that led the heap to get saturated. At this point the system will certainly decide to terminate you app process and free up memory for other tasks.

In order to see this more clearly, try to profile your app (launch it with Instruments) with the Leaks profiling template, play around with the app and try to reproduce the scenario that led to the crash until it gets stopped (terminated), at this point Instruments will provide you with more details.

Upvotes: 0

Related Questions