Monday, May 24, 2010

How to create a core dump file in linux during c / cpp programming?

i am not able to create a core dump file by executing the c programing . plz suggest that . how i should make it .

How to create a core dump file in linux during c / cpp programming?
Creating a core file is easy. Just do something illegal like


access invalid memory.


Put this in your code, it should crash your program.


strcpy (myUninitializeVar, anotherUnitializeVar, 10000000);





Make sure you declare myUnitializeVar, and anotherUnitializeVar, just don't initialize it or set it to some huge weird value.


This should cause a core dump.

snapdragon2

No comments:

Post a Comment