mfunyu / malloc

Find out the workings behind optimum memory management and recode it, as well as free and realloc.
2 stars 0 forks source link

[segfault] top value pointing at wrong place resulting in crash #26

Closed mfunyu closed 8 months ago

mfunyu commented 8 months ago
allocated from top (next top = 0x7f3b3f8096b0)
index : 72
result : 0x7f3b3f809318
size : 913
$> make correction FILENAME="test13.c"
$> MallocShowInFile=1 MallocShowHeap=1 LD_PRELOAD=./libft_malloc.so LD_LIBRARY_PATH=. ./correction 12 2> kk        
==================++==========================+
 0x7f3b3f8090a0   ||                          | 
------------------++--------------------------+
 0x7f3b3f8090a8   ||      864 (    0x368) |A|P| size
------------------++--------------------------+
 0x7f3b3f8090b0   ||                          | mem
 0x7f3b3f8090b8   || 3�?;                   | 
                  || (( abbriviated ))        | 
==================++==========================+
 0x7f3b3f809408   ||       0x2a2a2a2a2a2a2a2a | prev_size
------------------++--------------------------+
 0x7f3b3f809410   || 707406368 (0x2a2a2a2a2a2a2a28) |A|-| size
------------------++--------------------------+
 0x7f3b3f809418   || ********                 | mem
 0x7f3b3f809420   || ********                 | 
                  || (( abbriviated ))        | 
==================++==========================+