Results 1 to 3 of 3

Thread: Core Dump

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    1

    Core Dump

    I want to create a core dump file by writing a C programing, i have i ready gone thorugh several reference but i am not able to create it in RED HAT LINUX. plz suggest me how could i do this one and after that i need to run it in GDB.


  2. #2
    Contributing Member
    Join Date
    Dec 2007
    Answers
    46

    Re: Core Dump

    Lets follow a logical sequence to answer your question.

    1.
    When are core files are created? When the program does something bad.

    2.
    What is something bad?? Can be many things, but lets list some issues
    - divide by zero
    - accessing a bad pointer i.e. a pointer that is not legal

    3.
    So, when you write a program to do one of the above bad things, you will generate a core dump. Try it out.

    Hope that helps.


  3. #3
    Expert Member
    Join Date
    Jan 2008
    Answers
    133

    Re: Core Dump

    Been trying to post my reply to this thread, it doesnt seem to work. what the problem???

    a small program like the following generates core dump in my system and i am using fedora 6.
    1> make an variable of type int, ex: int p=5;
    and 2> print it as a string
    compile this program with gcc and run the exec file. this should generate the core dump file, but it keeps mum with just segmentation fault message, you need to issue the following command,
    ulimit -c 100000
    the number could be any size that your hard disk lets you afford. Then re-run this program again. It should generate the core dump file. examine that with gdb.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact