core dumps are HUGE...

From: John-Mark Gurney <gurney_j_at_resnet.uoregon.edu>
Date: Tue, 21 Mar 2006 10:40:19 -0800
If someone wants to spend some time investigating this, this looks like
an interesting puzzle:
-bash-2.05b$ cat t.c
int main() { char *p = 0; *p = 5; return 0;}
-bash-2.05b$ cc -static -o t t.c
-bash-2.05b$ ./t
Segmentation fault (core dumped)
-bash-2.05b$ ls -l t t.core
-rwxr-xr-x  1 jmg  jmg  179737 Mar 21 10:36 t
-rw-------  1 jmg  jmg  50049024 Mar 21 10:36 t.core

I first read that as 5megs, but it turns out that it's 50megs in size!
A 50 meg core dump for a static program that does nothing?  Though I
also have questsions about a 179k program file size for something that
doesn't call any functions...

Now the interesting part is that dynamicly linked:
-bash-2.05b$ cc -o t t.c
-bash-2.05b$ ./t
Segmentation fault (core dumped)
-bash-2.05b$ ls -l t t.core 
-rwxr-xr-x  1 jmg  jmg    4615 Mar 21 10:38 t
-rw-------  1 jmg  jmg  303104 Mar 21 10:38 t.core

only 303k...  Still on the hefty side of things for a program that
just cores, but better than static's 50megs...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
Received on Tue Mar 21 2006 - 17:40:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC