Closed mfunyu closed 7 months ago
index = get_index_by_size(size); if (!freelist[index]) return (NULL); chunk = freelist[index]; if (CHUNKSIZE(chunk) > MIN_CHUNKSIZE + size) { SD("size", size); SD("index", index); SD("chunk", CHUNKSIZE(chunk)); SP("chunk", chunk); show_alloc_mem_ex(); }
size : 528 index : 33 chunk : 1552 chunk : 0x7f3b3114daf0
$> make $> ./test/run_test.sh 14 $> MallocShowHeap=1 LD_PRELOAD=./libft_malloc.so LD_LIBRARY_PATH=. ./correction 2> f
It was caused by the false categorization of size when freeed
Reproduction