-
Junior Member
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.
-
Contributing Member
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.
-
Expert Member
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
-
Forum Rules