another talk on segmentation fault (core dumped)-Find the reason for the segment error
In the previous article "segmentation Fault (core dumped)" has said the specific core dumped produced the reason.
The following is mainly to introduce the problem of the solution and search, Linux is generally used to debug with GDB, then today I will take Ubuntu 14.04 environment as an introduction
To find the cause of the core dumped. What you need to explain is that you have to debug the option-G when compiling the program.
$ gcc-o App Reverse.c-g
Syntax: GDB applies Core
$ gdb App core.36129
There's going to be a bunch of stuff out there, so let's just leave it and enter the where in the input line.
Loaded symbols for/lib64/ld-linux-x86-64.so.2
Core is generated by './app '.
Program terminated with signal, segmentation fault.
#0 0x0000003262a56ed0 in _io_vfscanf_internal () from/lib64/libc.so.6
Missing separate Debuginfos, Use:debuginfo-install glibc-2.12-1.107.el6.x86_64
(GDB) where
#0 0x0000003262a56ed0 in _io_vfscanf_internal () from/lib64/libc.so.6
#1 0X0000003262A646CD in __isoc99_scanf () from/lib64/libc.so.6
#2 0x0000000000400607 in Main () reverse.c:10
(GDB)
That's where the core is going to be, first you see the order from the bottom of the list, because it's a " stack" order.
You can immediately see what causes the cause, interested can try.
Also note that if you run a lot of applications on your machine, the core you generate does not know which application is generated, you can use the following command
To view: File core
[/ipla_app01/test/]$ L
Total 124
-rwxrwxr-x 1 ipla_app01 ipla_app01 8438 Oct 8 14:12 App
-RW-------1 ipla_app01 ipla_app01 200704 Oct 8 14:17 core.36129
-rw-rw-r--1 IPLA_APP01 ipla_app01 386 Oct 8 14:11 reverse.c
[/ipla_app01/test/]$ file core.36129
From './app '