utnso@ubuntu-server:~$ gcc -g -o double_free double_free.c
utnso@ubuntu-server:~$ ./double_free
*** Error in `./double_free': double free or corruption (fasttop): 0x09cb8008 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x67377)[0xb75de377]
/lib/i386-linux-gnu/libc.so.6(+0x6d2f7)[0xb75e42f7]
/lib/i386-linux-gnu/libc.so.6(+0x6dc31)[0xb75e4c31]
./double_free[0x8048475]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0xb758f637]
./double_free[0x8048361]
======= Memory map: ========
08048000-08049000 r-xp 00000000 fc:00 1080245 /home/utnso/double_free
08049000-0804a000 r--p 00000000 fc:00 1080245 /home/utnso/double_free
0804a000-0804b000 rw-p 00001000 fc:00 1080245 /home/utnso/double_free
09cb8000-09cd9000 rw-p 00000000 00:00 0 [heap]
b7400000-b7421000 rw-p 00000000 00:00 0
b7421000-b7500000 ---p 00000000 00:00 0
b754e000-b756a000 r-xp 00000000 fc:00 1700661 /lib/i386-linux-gnu/libgcc_s.so.1
b756a000-b756b000 rw-p 0001b000 fc:00 1700661 /lib/i386-linux-gnu/libgcc_s.so.1
b7576000-b7577000 rw-p 00000000 00:00 0
b7577000-b7727000 r-xp 00000000 fc:00 1705948 /lib/i386-linux-gnu/libc-2.23.so
b7727000-b7729000 r--p 001af000 fc:00 1705948 /lib/i386-linux-gnu/libc-2.23.so
b7729000-b772a000 rw-p 001b1000 fc:00 1705948 /lib/i386-linux-gnu/libc-2.23.so
b772a000-b772d000 rw-p 00000000 00:00 0
b7737000-b7739000 rw-p 00000000 00:00 0
b7739000-b773b000 r--p 00000000 00:00 0 [vvar]
b773b000-b773c000 r-xp 00000000 00:00 0 [vdso]
b773c000-b775f000 r-xp 00000000 fc:00 1705946 /lib/i386-linux-gnu/ld-2.23.so
b775f000-b7760000 r--p 00022000 fc:00 1705946 /lib/i386-linux-gnu/ld-2.23.so
b7760000-b7761000 rw-p 00023000 fc:00 1705946 /lib/i386-linux-gnu/ld-2.23.so
bfaa9000-bfaca000 rw-p 00000000 00:00 0 [stack]
Aborted (core dumped)
Created
July 25, 2020 21:29
-
-
Save mgarciaisaia/11bb19e88a23227866dcd3e3514a3fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
int main(void) { | |
void *memory = malloc(10); | |
free(memory); | |
free(memory); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment