From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 9 19:30:17 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE497106567B for ; Mon, 9 Jul 2012 19:30:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8609F8FC17 for ; Mon, 9 Jul 2012 19:30:17 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q69JUHXS047050 for ; Mon, 9 Jul 2012 19:30:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q69JUHUp047046; Mon, 9 Jul 2012 19:30:17 GMT (envelope-from gnats) Resent-Date: Mon, 9 Jul 2012 19:30:17 GMT Resent-Message-Id: <201207091930.q69JUHUp047046@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8DBE106575E for ; Mon, 9 Jul 2012 19:21:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id B23D78FC0C for ; Mon, 9 Jul 2012 19:21:00 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q69JL0gY062492 for ; Mon, 9 Jul 2012 19:21:00 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q69JL0eQ062491; Mon, 9 Jul 2012 19:21:00 GMT (envelope-from nobody) Message-Id: <201207091921.q69JL0eQ062491@red.freebsd.org> Date: Mon, 9 Jul 2012 19:21:00 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/169748: [bsdinstall] when distfile fetch is complete on some distfiles, but not entire set, progress can go over 100%; installer gets confused with distfiles and halts X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 19:30:17 -0000 >Number: 169748 >Category: bin >Synopsis: [bsdinstall] when distfile fetch is complete on some distfiles, but not entire set, progress can go over 100%; installer gets confused with distfiles and halts >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 09 19:30:17 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9.0-RELEASE >Organization: EMC Isilon >Environment: (x86 install) >Description: The FTP download choked on base.txz (corp. firewall issue), but continued downloading the rest of the distfiles, then asked if I wanted to retry downloading the files. 2nd try crashed and burned (the progress bar went over 100% and the installer halted). >How-To-Repeat: 1. Download the network installer. 2. Nuke or taint one of the tarballs such that it fetches but fails to extract, or corrupt one of the bytes in the file. >Fix: The attached patch (truncate the file) isn't optimal, but it's simple and will address multiple potential issues dealing with distfile fetch failures without introducing having to introduce the whacky state machine that was present in sysinstall (and in many cases got things wrong). An alternate, less failure prone method should be provided which can operate outside of the installer if download retrying is needed. That and there's no guarantee that the upstream FTP/HTTP server supports download resume until the fetch is attempted. Patch attached with submission follows: Index: usr.sbin/bsdinstall/distfetch/distfetch.c =================================================================== --- usr.sbin/bsdinstall/distfetch/distfetch.c (revision 238086) +++ usr.sbin/bsdinstall/distfetch/distfetch.c (working copy) @@ -151,7 +151,7 @@ items[i*2 + 1] = "In Progress"; fsize = 0; - file_out = fopen(items[i*2], "w+"); + file_out = fopen(items[i*2], "w"); if (file_out == NULL) { snprintf(errormsg, sizeof(errormsg), "Error while fetching %s: %s\n", >Release-Note: >Audit-Trail: >Unformatted: