Generating Core Dump

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • afrah
    New Member
    • Jul 2010
    • 12

    Generating Core Dump

    I have a program that crashes, After it crashes I want to know the stack trace. coredump can give me that. I am trying to enable this before program starts, so that once the program crashes I would know where exactly it is crashing.
    I have enabled core dump using
    ulimit -c unlimited
    and then gave a command
    gcore pid

    I get a file core.pid in my current working Directory.
    But I am not able to view its content.
    I am not sure that the steps i did for generating the dump are correct also how to open this core file.
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    you will need gdb.
    run gdb like this:

    gdb your_program_na me core.pid

    you will be thrown to 'gdb:' prompt.
    here you can type 'bt' or 'backtrace' to print the stack trace when crash occured.

    Comment

    Working...