本文共 839 字,大约阅读时间需要 2 分钟。
本文持续更新
进程试图写不能写的内存
char *p = 0;*p = 1;
segfault at 0 ip 0000000000400541 sp 00007ffc4eba93e0 error 6 in a.out[400000+1000]
进程试图读不能读的内存
char *p = 0;char c = *p;
segfault at 0 ip 00000000004004fd sp 00007ffe321ef0f0 error 4 in a.out[400000+1000]
char *p = malloc(128);free(p);free(p);
Error in `./a.out': double free or corruption (fasttop): 0x0000000000a42010
======= Backtrace: =========
/lib64/libc.so.6(+0x81499)[0x7fbe685b9499]./a.out[0x4005ab]/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fbe6855a445]./a.out[0x4004b9]======= Memory map: ========00400000-00401000 r-xp 00000000 fd:11 56369896 /mnt/situo.cly/yq/a.out... [heap]7fbe64000000-7fbe64021000 rw-p 00000000 00:00 0 ...Aborted (core dumped)abort();
assert(0);
Aborted (core dumped)
int x = 3 / 0;
Floating point exception (core dumped)
转载地址:http://petpl.baihongyu.com/