Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jul 2012 19:21:00 GMT
From:      Garrett Cooper <yanegomi@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
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
Message-ID:  <201207091921.q69JL0eQ062491@red.freebsd.org>
Resent-Message-ID: <201207091930.q69JUHUp047046@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207091921.q69JL0eQ062491>