From owner-freebsd-current Sat Sep 7 3:55:14 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7414A37B400; Sat, 7 Sep 2002 03:55:10 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5821043E6E; Sat, 7 Sep 2002 03:55:09 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA03009; Sat, 7 Sep 2002 20:55:06 +1000 Date: Sat, 7 Sep 2002 21:02:39 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "Bruce A. Mah" Cc: Poul-Henning Kamp , Subject: Re: libmd bug on -CURRENT In-Reply-To: <200209061955.g86JtXsS005708@intruder.bmah.org> Message-ID: <20020907204720.R19001-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 6 Sep 2002, Bruce A. Mah wrote: > If memory serves me right, Poul-Henning Kamp wrote: > > > Good catch. > > > > I'm surprised the compiler doesn't whine. > > Thanks, and "me too". Warnings are mostly turned off for not unimportant places like libraries since these places are too poorly written to compile without warnings. > PS. Actually I'm surprised that nobody caught the problem in the past > five months...this bug prevented release builds from 5-CURRENT hosts. > Maybe I'm the only person crazy enough to try this. :-) This bug was caught in PR 42384. The fix in the PR is not so good. libmd is also broken for some cases involving pipes. IIRC, this is caused by the bogus st_size checks in the same function. st_size is only valid for regular files. The loop in the function fails to to terminate if read() returns 0, which can probably happen if the file shrinks underneath us. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message