From owner-freebsd-arch@FreeBSD.ORG Tue Jul 27 17:24:04 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3433716A4CE for ; Tue, 27 Jul 2004 17:24:04 +0000 (GMT) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id D29AC43D41 for ; Tue, 27 Jul 2004 17:24:03 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i6RHO18Y012431; Tue, 27 Jul 2004 13:24:02 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <410684A0.5C65ED42@bellatlantic.net> References: <20040718184008.GC57678@darkness.comp.waw.pl> <20040719075952.GG57678@darkness.comp.waw.pl> <20040719.081356.51946167.imp@bsdimp.com> <200407191855.19885.max@love2party.net> <20040727032253.GA24778@gothmog.gr> <410684A0.5C65ED42@bellatlantic.net> Date: Tue, 27 Jul 2004 13:24:00 -0400 To: Sergey Babkin From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-arch@freebsd.org Subject: Re: some PRs X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 17:24:04 -0000 At 12:36 PM -0400 7/27/04, Sergey Babkin wrote: >Giorgos Keramidas wrote: >> > > On 2004-07-26 19:49, Sergey Babkin wrote: > > > >> > 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. > > 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 >program fail. If it does not fail, there is a bug. That's >much easier than producing an actual full filesystem. The problem is that using /dev/full on a good program will only test a single write() command. If I have a program which does writes at 10 different points, and the program fails when pointed at /dev/full, I still do not know if ALL of those writes are doing the appropriate checking. Maybe nine of them do zero checking, and only one of them checks (and that one may be the final write(), not the first one). Using /dev/full on such a program will still get the failure indication, and the developer (or user) will think the program is correct, when in fact it is 9/10ths wrong. The problem is that a full filesystem can happen at any point in the program's execution, not just the first write(). While /dev/full might be some help in testing, I do not believe it is as useful as you seem to think it is. I am not against the idea of /dev/full, but I am not particularly for it either... -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu