How to generate core dump file in Linux?
gcc, gdb, linux
Solution
The generation of core dump files it is not always enabled. Try with the ulimit command.
Problem
I am trying to generate the core dump file using the below program in Linux. ``` #include <stdio.h> #include<iostream> using namespace std; int main() { char *temp ="ABCDE"; int i =0; temp[3] ='F'; for (i =0; i <5; i++) printf("% Value is %c\n", temp[i]); cout<<"Done"<<endl; return 0; } ``` I saved the above source code as sample.cpp and build the file using the below command. ``` g++ sample.cpp -g -o test ``` Run the output file "test" which produced the error "Segmentation fault". But it didn't generate the core dump file. ``` ./test ``` I refereed this . Thanks for your help.