If a problem occurs, you do not know how to solve it. If a segment error occurs, the problem cannot be solved. Try the core file information!
Core File Method
1. Where can I create a core file?
Create in the current working directory of the process. It is usually in the same path as the program. However, if the chdir function is called in the program, the current working directory may be changed. The core file is created under the path specified by chdir. Many programs have crashed, but we cannot find the location of the core file. It is related to the chdir function. Of course, not all core files are generated when the program crashes.
2. When will the core file not be generated?
Core files are not generated under the following conditions:
(A) The process is set-user-ID, and the current user is not the owner of the program file;
(B) The process is set-group-ID, and the current user is not the group owner of the program file;
(C) The user has no permission to write the current working directory;
(D) The file is too large. Core File Permission (assuming that the file does not exist before) is usually User read/write, Group read and other reads.
3. How to generate a core file?
By default, the system prohibits the generation of core files.
[Root @ localhost ~] # Ulimit-C
0
[Root @ localhost ~] # Ulimit-C 1000
Allows the generation of core files with a size limit of 1000
If the core file still cannot be generated, check whether the program has the current directory permission.
[Root @ localhost ~] # GDB quesimv Core
The specific error location is located.