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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avinash jain
    New Member
    • Aug 2007
    • 12

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

    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..
  • arne
    Recognized Expert Contributor
    • Oct 2006
    • 315

    #2
    Originally posted by avinash jain
    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.

    Code:
    gdb <executable file> <core file>
    Google is your friend to find out how to proceed from here on.

    HTH,
    arne

    Comment

    Working...