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

[crush] with unmalloced call to free #49

Closed mfunyu closed 5 months ago

mfunyu commented 5 months ago
$> LD_PRELOAD=./libft_malloc.so MallocDebug=1 bash
[ malloc]                 : malloc(6) = 0x7f5212f25300
[ malloc]                 : malloc(6) = 0x7f5212f25320
[ malloc] by hash_insert  : malloc(32) = 0x7f5212f25340
[ malloc] by make_variable_value : malloc(3) = 0x7f5212f25370
[ malloc]                 : malloc(48) = 0x7f5212f25390
[ malloc]                 : malloc(8) = 0x7f5212f253d0
[ malloc]                 : malloc(8) = 0x7f5212f253f0
[ malloc] by hash_insert  : malloc(32) = 0x7f5212f25410
[ malloc] by make_variable_value : malloc(3) = 0x7f5212f25440
[ malloc] by _rl_init_terminal_io : malloc(2032) = 0x7f520cbeec10
[ malloc] by _rl_init_terminal_io : malloc(4080) = 0x7f520cbef410
[ malloc] by __strdup     : malloc(15) = 0x7f5212f25460
[ malloc] by _nc_home_terminfo : malloc(25) = 0x7f5212f25480
[ malloc] by __strdup     : malloc(13) = 0x7f5212f254b0
[ malloc] by _nc_first_db : malloc(94) = 0x7f5212f254d0
[   free] by _nc_read_entry2 : free(0x558795f0c610)
[1]    47934 segmentation fault (core dumped)  LD_PRELOAD=./libft_malloc.so MallocDebug=1 bash