By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,673 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,673 IT Pros & Developers. It's quick & easy.

how to create a core dump file in G++ compiller

P: 12
I got a segmentation fault..
I came to know that the problem could be easliy solved be the core dump files.
could any tell how to create a core dump file and how to read a core dump file.
I am using g++ compliier..
Oct 3 '07 #1
Share this Question
Share on Google+
1 Reply

arne
Expert 100+
P: 315
I got a segmentation fault..
I came to know that the problem could be easliy solved be the core dump files.
could any tell how to create a core dump file and how to read a core dump file.
I am using g++ compliier..
If your program crashes, it will leave a core file (named 'core'), unless the allowed core file size is 0: invoke 'ulimited -c' to check. If the result is '0', call ' ulimit -c unlimited' to set the core file size to "infinite".

There is also the gcore utility which can create a core file of a running process (useful if you need a snapshot of a program in a weird state).

For core dump ananlysis, use gdb, e.g.

Expand|Select|Wrap|Line Numbers
  1. gdb <executable file> <core file>
  2.  
Google is your friend to find out how to proceed from here on.

HTH,
arne
Oct 4 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.