Article View: comp.bugs.sys5
Article #1064Re: ulimit and what it is useful for
From: John Woods
Date: Tue, 25 Apr 1989 23:53
Date: Tue, 25 Apr 1989 23:53
47 lines
2776 bytes
2776 bytes
Subject: Re: ulimit (was: getty/login for callback)
Newsgroups: alt.flame
References: <180001@mechp10.UUCP> <13853@rpp386.Dallas.TX.US> <797@twwells.uucp> <863@twwells.uucp>
In article <863@twwells.uucp>, bill@twwells.uucp (T. William Wells) writes:
> In article <1295@frog.UUCP> john@frog.UUCP (SuperUser) writes:
> : However, using ulimit() to test that makes it harder to discover that your
> : application recovers from that by creating another file and logging a message
> : to it.
> Huh? If ulimit causes a failure, one can always create or extend
> another file, so long as that file is smaller than the ulimit.
That was my point. ulimit() is useless in general for testing the
full-filesystem condition because it is a per-file OFFSET limit.
If your application recovers from an out-of-space condition by logging
a message to another file, it had better watch out for another out-of-space
condition -- and ulimit() is NOT a convenient way to test that.
(ulimit() gripe number two:
f = creat("foo", 0666);
lseek(f, 12*1024*1024, 0);
write(f, "bar", 3);
close(f);
The preceeding sequence creates a file occupying one data block plus
2 indirect blocks. Why does a 1Mb ulimit() prevent it from working?
Answer: ulimit() was badly thought out).
> : If you aren't going to buy enough hardware to properly test your software,
> : why bother with testing at all?
>
> Don't be silly. All test environments are deficient in some way or
> another. It's called cost. And practicality. It is wholly useless to
> argue that one should have extra hardware to test an error condition
> when it is entirely possible and extremely easy to simulate the error
> condition using software.
>
An easy way to test the out-of-space condition is to make a small disk
partition and fill it quickly, on a development machine where no-one will
complain that you have filled a disk partition. A wrong way to test
it is to use ulimit().
I apologize for the perceived tone of my posting. But the statement that
ulimit() is useful for testing filesystem-full conditions is plainly false.
ulimit() is solely useful for testing the ulimit-exceeded condition.
--
John Woods, Charles River Data Systems, Framingham MA, (508) 626-1101
...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu
Technical Details
Message-ID:
<1316@frog.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!mirror!frog!johnReferences:
<180001@mechp10.UUCP> <13853@rpp386.Dallas.TX.US> <797@twwells.uucp> <863@twwells.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.bugs.sys5 Subject: Re: ulimit and what it is useful for Message-ID: <1316@frog.UUCP> Date: 25 Apr 89 23:53:00 GMT References: <180001@mechp10.UUCP> <13853@rpp386.Dallas.TX.US> <797@twwells.uucp> <863@twwells.uucp> Organization: Misanthropes-R-Us Lines: 47