[comp.unix.questions] 2Gb core file

fischer@iesd.auc.dk (Lars P. Fischer) (02/08/91)

>>>>> hunt@dg-rtp.rtp.dg.com writes:
hunt> My bet is that there are very large unallocated holes in the file.
hunt> That's one reasonable way to make core files.

>>>>> On 3 Feb 91 09:39:57, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) said:

Dan> Well, one school of thought says that this is a quite unreasonable way
Dan> to make core files---or any files---when the holes are so easy to avoid.
Dan> It's remarkable how often users accidentally fill up disks under SunOS
Dan> by copying or otherwise processing those core files. 

One could argue, quite reasonably, that this is a problem with cp.
Allowing files with holes is a nice feature of UNIX. That some tools
have not been designed to process them should not discourage their use.

Dan> It's also quite a
Dan> waste of time to do ``strings'' on a 2GB file with practically nothing
Dan> but nulls; if the same information were stored in 160K, things would run
Dan> a lot faster.

Never had any problems with this.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Beauty is a French phonetic corruption
CS Dept., Univ. of Aalborg, DENMARK. |                   - FZ

richard@aiai.ed.ac.uk (Richard Tobin) (02/12/91)

In article <FISCHER.91Feb7204810@thiele.iesd.auc.dk> fischer@iesd.auc.dk (Lars P. Fischer) writes:
>Dan> It's remarkable how often users accidentally fill up disks under SunOS
>Dan> by copying or otherwise processing those core files. 

[It's also remarkable how much disk space is saved by putting "limit
core 0" in users' initial .login files.]

>One could argue, quite reasonably, that this is a problem with cp.
>Allowing files with holes is a nice feature of UNIX. That some tools
>have not been designed to process them should not discourage their use.

If you put the solution in cp, you have to put it in every other
program that essentially copies a file (cat, tar, tr ...).  If you
want the problem solved for all such programs, the thing to do is to
have the kernel always leave holes for all-zero blocks (you could also
partially solve it by putting it in stdio).  This has disadvantages -
it would slow writing files a little in the usual case, and it would
mean that if you wanted to preallocate file space you'd have to use
something other than zeros.

>Dan> Well, one school of thought says that this is a quite unreasonable way
>Dan> to make core files---or any files---when the holes are so easy to avoid.

I certainly think Sun made a mistake here.  But on the other hand, they
make money from selling disk, don't they :-)

-- Richard
-- 
Richard Tobin,                       JANET: R.Tobin@uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin