Re: some PRs
From: Sergey Babkin (babkin_at_bellatlantic.net)
Date: 07/27/04
- Previous message: Sergey Babkin: "Re: some PRs"
- In reply to: Giorgos Keramidas: "Re: some PRs"
- Next in thread: Pawel Jakub Dawidek: "Re: some PRs"
- Reply: Pawel Jakub Dawidek: "Re: some PRs"
- Reply: Garance A Drosihn: "Re: some PRs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jul 2004 12:36:48 -0400 To: Giorgos Keramidas <keramida@ceid.upatras.gr>
Giorgos Keramidas wrote:
>
> On 2004-07-26 19:49, Sergey Babkin <babkin@bellatlantic.net> wrote:
> > Max Laier wrote:
> > > The question to me is, do we really want to support (read fertilize)
> > > such a stupid thing? Given the chance that once we do support it
> > > people will use it. In my opinion it is bad to integrate something
> > > into base that we agree is nothing one should ever have created (at
> > > least that's my reading of the thread so far). I see no user-pessure
> > > for this.
> >
> > I'm about a week behind :-) but here are my 2 cents: it's a VERY
> > useful device for testing. Not checking the error code of write(),
> > printf() and such is a typical bug, so making it easy to detect by
> > switching the output to /dev/full (or creating a symlink to it) is a
> > very good idea. Like this:
> >
> > yourprogram >/dev/full \
> > && echo "The program does not check for success of write()"
>
> If a program doesn't check the return code of write() but merrily goes
> on doing other stuff or even terminates with a zero return value, how
> will the redirection affect its operation? I think it won't, as shown
> in the test below (run on a Linux machine):
If you run a test in which you know the program must fail (such
as writing to /dev/full) yet it does not, this means that there
is abug in the program.
> : $ ls -ld /dev/full
> : crw-rw-rw- 1 root root 1, 7 Jun 14 00:24 /dev/full
> : $ cat -n lala.c
> : 1 #include <sys/types.h>
> : 2 #include <string.h>
> : 3 #include <unistd.h>
> : 4
> : 5 int
> : 6 main(void)
> : 7 {
> : 8 char buf[] = "hello world\n";
> : 9 size_t len;
> : 10
> : 11 len = strlen(buf);
> : 12 write(1, buf, len);
> : 13 return 0;
> : 14 }
> : $ cc -O -W -Wall -o lala lala.c
> : $ ./lala
> : hello world
> : $ ./lala >/dev/full
> : $ echo $?
> : 0
> : $
>
> The fact that /dev/full was used as the output device didn't reveal the
> potential write() problem.
That's _exactly my point: if the program writes to /dev/full
and yet does produce an error exit code or an error message,
there is a bug in the program.
> I must have misunderstood something. How do you mean that we could use
> /dev/full for testing?
Well, as described above: for each file that your program can produce,
try to substitute it with /dev/full and watch the prgoram fail.
If it does not fail, there is a bug. That's much easier than producing
an actual full filesystem.
-SB
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Sergey Babkin: "Re: some PRs"
- In reply to: Giorgos Keramidas: "Re: some PRs"
- Next in thread: Pawel Jakub Dawidek: "Re: some PRs"
- Reply: Pawel Jakub Dawidek: "Re: some PRs"
- Reply: Garance A Drosihn: "Re: some PRs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- coreutils-6.11 released
... 300 in gnulib. ... you can run this command ... -fR to copy a
fifo or "special" file onto an existing file would fail ... [bug introduced in coreutils-5.90]
... (gnu.announce) - Re: embedded in strings
... This looks like a bug. ... out why the index is causing this to fail.
... | queries with vaues longer than the column being queried. ... |> | query
analyzer if you want to see what I'm talking about. ... (microsoft.public.sqlserver.ce) - Re: TDD: Test-Driven Design or Test-Driven Development?
... > If you intent to get tests pass you'll succeed. ... > software with
intention to make it fail you'll succeed again. ... "If you are curious, or code does something
unexpected, or you receive a bug ... If they write a test that fails due to missing
abilities, ... (comp.object) - Re: how many bugs do you find and correct during TDD?
... > first you write a test you expect to fail. ... If it is not as expected,
is that a bug, an imporperly written ... > request, or the request itself was
the result of a misunderstanding of the ... (comp.object) - Re: Possible shared mapping bug in 2.4.23 (at least MIPS/Sparc)
... > Don't blame the kernel - the kernel is only doing what the user asked it ...
Surely it's better to fail the mmapon other archs ... It's a bug either way ...
... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel)