Core Dump - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Core Dump

How do I make a program do a compulsory core dump in linux using C coz I had some problem with my code and it did a Core Dump but unfortunately I deleted it and now the program is not dumping, I haven't changed the code at all.

Comments

  • CitorCitor Posts: 1Member
    : How do I make a program do a compulsory core dump in linux using C coz I had some problem with my code and it did a Core Dump but unfortunately I deleted it and now the program is not dumping, I haven't changed the code at all.
    :

    Try: # ulimit -c unlimited (in your shell) and then run the program again. In theory "core" file appear in the same directory. Sorry for my english :)
  • korkor Posts: 198Member
    : : How do I make a program do a compulsory core dump in linux using C coz I had some problem with my code and it did a Core Dump but unfortunately I deleted it and now the program is not dumping, I haven't changed the code at all.
    : :
    :
    : Try: # ulimit -c unlimited (in your shell) and then run the program again. In theory "core" file appear in the same directory. Sorry for my english :)
    :
    You could insert some inline assembler to jmp to somewhere out of range, possibly the stack segment. You could insert an int3 instruction, again in inline assembler. I believe there's a syscalll for it, as well.
    Note: int3 will only work if you don't use a debugger, as it is a debugger breakpoint. Also note that core dumps include soem realtime program info, including register states. Unless you can exactly mimic the core dump, you won't get the same info.
  • satharielsathariel Posts: 59Member
    : : How do I make a program do a compulsory core dump in linux using C coz I had some problem with my code and it did a Core Dump but unfortunately I deleted it and now the program is not dumping, I haven't changed the code at all.
    : :
    :
    : Try: # ulimit -c unlimited (in your shell) and then run the program again. In theory "core" file appear in the same directory. Sorry for my english :)
    :
    To "force" the dump, You can kill the process/program via "kill -3". Than the program will be ended with a core dump. But You have to ensure, that the ulimit for core is big enough (via "ulimit -a"). You set it as above.
    [black]SaThaRiel[/black]

Sign In or Register to comment.