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

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.