From owner-freebsd-bugs Thu May 23 17:00:16 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA06852 for bugs-outgoing; Thu, 23 May 1996 17:00:16 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA06823; Thu, 23 May 1996 17:00:08 -0700 (PDT) Resent-Date: Thu, 23 May 1996 17:00:08 -0700 (PDT) Resent-Message-Id: <199605240000.RAA06823@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, taob@io.org Received: from cabal.io.org (cabal.io.org [198.133.36.103]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA06522 for ; Thu, 23 May 1996 16:55:32 -0700 (PDT) Received: (from taob@localhost) by cabal.io.org (8.7.5/8.7.3) id TAA11573; Thu, 23 May 1996 19:54:51 -0400 (EDT) Message-Id: <199605232354.TAA11573@cabal.io.org> Date: Thu, 23 May 1996 19:54:51 -0400 (EDT) From: taob@io.org Reply-To: taob@io.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1240: Cosmetic format error in pkg_* Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1240 >Category: bin >Synopsis: Wrong format used to print amount of free disk space >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 23 17:00:07 PDT 1996 >Last-Modified: >Originator: Brian Tao >Organization: Internex Online Inc., Toronto, Ontario, Canada >Release: FreeBSD 2.2-960501-SNAP i386 >Environment: Need /var/tmp filesystem with > 2GB free space and/or package larger than 2GB uncompressed. >Description: The size of the package and the amount of free disk space in /var/tmp are size_t ints when they probably ought to be off_t ints. At the very least, they should be unsigned. >How-To-Repeat: # df /var/tmp Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/sd0s1f 3476622 459 3198034 0% /var # pkg_add -v top-3.3.tgz Requested space: 86840 bytes, free space: -1020177408 bytes in /var/tmp/instmp.010105 [...] >Fix: This is an incomplete fix in that filesystems with more than 4GB of free space will produce the format error. I tried replacing the size_t's with off_t's, but the disk space check in find_play_pen() would incorrectly think that (for example) 3274789888 was not greater than 86840. Is this a comparison bug in gcc? *** /usr/src/usr.sbin/pkg_install/lib/pen.c Thu May 23 19:32:41 1996 --- /usr/src/usr.sbin/pkg_install/lib/pen.c-orig Thu May 23 19:31:51 1996 *************** *** 87,93 **** } if (Verbose) { if (sz) ! fprintf(stderr, "Requested space: %d bytes, free space: %u bytes in %s\n", (int)sz, min_free(pen), pen); } if (min_free(pen) < sz) { rmdir(pen); --- 87,93 ---- } if (Verbose) { if (sz) ! fprintf(stderr, "Requested space: %d bytes, free space: %d bytes in %s\n", (int)sz, min_free(pen), pen); } if (min_free(pen) < sz) { rmdir(pen); >Audit-Trail: >Unformatted: