- 论坛徽章:
- 5
|
本帖最后由 T-Bagwell 于 2012-04-28 18:23 编辑
求文件系统格式
至少文件系统要保证能够写文件
举例
- [root@centos1 c_leard]#
- [root@centos1 c_leard]# ls
- a test test2.c test.c
- [root@centos1 c_leard]# cat test2.c
- #include <stdio.h>
- #include <string.h>
- void fuck2()
- {
- char *test = "abcdefg";
- strcpy(test, "fuck");
- }
- void fuck1()
- {
- fuck2();
- }
- void fuck ()
- {
- fuck1();
- }
- int main()
- {
- fuck();
- return ;
- }
- [root@centos1 c_leard]# gcc test2.c -o test2
- [root@centos1 c_leard]# ulimit -c unlimited
- [root@centos1 c_leard]# ./test2
- Segmentation fault (core dumped)
- [root@centos1 c_leard]# ls
- a core.2669 test test2 test2.c test.c
- [root@centos1 c_leard]# gdb -c core.2669 ./test2
- GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
- Copyright (C) 2010 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software: you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law. Type "show copying"
- and "show warranty" for details.
- This GDB was configured as "x86_64-redhat-linux-gnu".
- For bug reporting instructions, please see:
- <http://www.gnu.org/software/gdb/bugs/>...
- Reading symbols from /root/c_leard/test2...(no debugging symbols found)...done.
- [New Thread 2669]
- Missing separate debuginfo for
- Try: yum --disablerepo='*' --enablerepo='*-debuginfo' install /usr/lib/debug/.build-id/e3/288ac29ed63015d8781dcf763cafadd212d6c9
- Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
- Loaded symbols for /lib64/libc.so.6
- Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
- Loaded symbols for /lib64/ld-linux-x86-64.so.2
- Core was generated by `./test2'.
- Program terminated with signal 11, Segmentation fault.
- #0 0x00007fe797b4dd21 in memcpy () from /lib64/libc.so.6
- Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.7.el6.x86_64
- (gdb) bt
- #0 0x00007fe797b4dd21 in memcpy () from /lib64/libc.so.6
- #1 0x00000000004004ed in fuck2 ()
- #2 0x00000000004004fd in fuck1 ()
- #3 0x000000000040050d in fuck ()
- #4 0x000000000040051d in main ()
- (gdb)
复制代码 |
|