Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS error : Heap corruption detected, free list is damaged and Incorrect guard value: 0

GFF_MJ(3248,0x103f9ab80) malloc: Heap corruption detected, free list is damaged at 0x28298ffa0
*** Incorrect guard value: 0
GFF_MJ(3248,0x103f9ab80) malloc: *** set a breakpoint in malloc_error_break to debug

Error screenshot:

enter image description here

After running for a while, the app always crashes, but I won't get any information except the above tips. Now I don't know how to solve it, who can help me?

Thank you.

like image 995
GUOHUA Avatar asked Sep 20 '18 07:09

GUOHUA


People also ask

What can cause heap corruption?

Heap corruption occurs when a program damages the allocator's view of the heap. The outcome can be relatively benign and cause a memory leak (where some memory isn't returned to the heap and is inaccessible to the program afterward), or it may be fatal and cause a memory fault, usually within the allocator itself.


1 Answers

These bugs are no fun. Most likely, you have a buffer overflow somewhere or you are using a piece of memory after it has been freed and stomping on something else.

Since you can get it to crash in the debugger, that makes it much easier to track down.

Start by setting a breakpoint on malloc_error_break, as the error message instructs you to do. When you hit that breakpoint, that'll provide more of a clue, but still may be rather vague. However, you'll be able to post more clues and we can help you from there.

like image 144
bbum Avatar answered Sep 24 '22 16:09

bbum