PDA

View Full Version : Core dump vanishes



jonface
April 22nd, 2007, 07:30 PM
Whenever a C program dumps the core for whatever reason, it seems to get deleted. At first I thought it wasn't doing it but if I did:

"watch -n 0.2 myProg" and in another terminal "watch -n 0.2 cp core core.bak" I might just catch it in time.

I googled around but only found people who never get the core dump, not people who get it but it gets deleted.

Any ideas?

Ta.

2.6.17-11-generic
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)

amo-ej1
April 23rd, 2007, 07:35 AM
have you enabled core dump ?



ulimit -c 900000


this sets the maximum size of a core dump to 900000, by default this is disabled ;)

jonface
April 23rd, 2007, 06:31 PM
I'm such a muppet, spelt it wrong the first time I tried it, 'unlimit' . Thanks!!