嘻嘻
我正在使用 gdb 来利用我的程序
int main(int argc, char *argv[]) {
if(argc < 2) {
printf("You have vergotten to fill in a value\n");
exit(0);
}
char buffer[10];
strcpy(buffer, argv[1]);
printf("the value you supplie is ");
printf(buffer);
printf("\n");
return 0;
}
在他输入的vindeo教程中,在gdb中“运行AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”应该变成:
program received signal SIGSEGV, sementation fault.
0x41414141 in ?? ()
但我得到了 SIGABRT
*** stack smashing detected ***: /root/Desktop/out terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7ffff7b59217]
/lib/libc.so.6(__fortify_fail+0x0)[0x7ffff7b591e0]
/root/Desktop/out[0x400759]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7ffff7a78c4d]
/root/Desktop/out[0x400609]
======= Memory map: ========
00400000-00401000 r-xp 00000000 08:01 148883 /root/Desktop /out
00600000-00601000 r--p 00000000 08:01 148883 /root/Desktop /out
00601000-00602000 rw-p 00001000 08:01 148883 /root/D
等等,然后是 SIGABRT
我得到 SIGABRT 而不是 SIGSEGV 的原因是什么?