From owner-freebsd-sysinstall@FreeBSD.ORG Mon Nov 22 11:07:15 2010 Return-Path: Delivered-To: freebsd-sysinstall@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D4FF1065675 for ; Mon, 22 Nov 2010 11:07:15 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 61AC78FC1C for ; Mon, 22 Nov 2010 11:07:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAMB7FPI051876 for ; Mon, 22 Nov 2010 11:07:15 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAMB7Ems051872 for freebsd-sysinstall@FreeBSD.org; Mon, 22 Nov 2010 11:07:14 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 22 Nov 2010 11:07:14 GMT Message-Id: <201011221107.oAMB7Ems051872@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-sysinstall@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-sysinstall@FreeBSD.org X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2010 11:07:15 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/152270 sysinstall sysinstall(8) Load KLD Segfault o bin/151229 sysinstall sysinstall(8) - shift-tab doesn't work as expected o bin/150995 sysinstall sysinstall(8): corruption of partition table s bin/150237 sysinstall sysinstall(8): Suggestion: installer should suggest th o amd64/148805 sysinstall [hang] FreeBSD 7.2, 8.0, and 9.0 hang during install a f bin/148220 sysinstall sysinstall(8): 9.0-current gets "Cannot resolv hostnam o bin/148201 sysinstall sysinstall(8): core dump (Error 10) while trying to in o bin/146299 sysinstall sysinstall(8): cannot create slice o bin/145735 sysinstall sysinstall(8) trashes Vista-created partition tables o bin/142867 sysinstall sysinstall(8): in a custom installation re-entering th o bin/140843 sysinstall sysinstall(8): cannot software install from usb o bin/140842 sysinstall sysinstall(8): destroyed ncurses interface with FBSD8. o bin/138423 sysinstall sysinstall(8): Installer (and sade) get wrong number o o bin/137864 sysinstall [patch] sysinstall(8): add possibility to shutdown/pow o bin/137713 sysinstall sysinstall(8): installer partition editor generates in f bin/136161 sysinstall sysinstall(8) installs wrong architecture on amd64 o bin/129762 sysinstall sysinstall(8) doesn't seem to support GPT for EFI boar s bin/123304 sysinstall sysinstall(8): missing sensible and user friendly prog o bin/121503 sysinstall sysinstall(8): 7.0 upgrade doesn't let me mount all of o bin/119077 sysinstall [patch] sysinstall(8) - reading packages from index is o bin/113979 sysinstall [patch] sysinstall(8) does not support UFS1 filesystem o bin/112757 sysinstall sysinstall(8): sysinstall(8): in the FDISK tool we can o bin/108191 sysinstall sysinstall(8): Disklabel editor help text (by F1 key) o bin/107830 sysinstall sysinstall(8): Change Units (Z) in fdisk doesn't work o bin/102498 sysinstall sysinstall(8): Cursor doesn't track sysinstall hilight a bin/101762 sysinstall sysinstall(8) does not obey /usr/ports symlink while i o bin/97108 sysinstall sysinstall(8): write failure on transfer (wrote -1 byt o bin/93275 sysinstall sysinstall(8): Failure to install after restarting ins o bin/90656 sysinstall sysinstall(8): 6.0-RELEASE (i386) cannot be installed o bin/80371 sysinstall cannot install 5.4-RC3 from DOS partition o bin/79840 sysinstall sysinstall(8): Partitioning and formating a new disk f o bin/79621 sysinstall sysinstall(8): sysinstall(8) does not create a device o bin/78964 sysinstall sysinstall(8): can not write labels to hdd on installa f bin/73511 sysinstall sysinstall(8): SCSI drive install failure - RC2 o bin/73410 sysinstall sysinstall(8): Sysinstall could not allocate disklabel o bin/72895 sysinstall sysinstall(8): Sysinstall generates invalid partition o bin/70002 sysinstall sysinstall(8): fails to locate FTP dirs if the OS has o bin/69986 sysinstall sysinstall(8): [patch] no job control in fixit shell o o bin/69942 sysinstall sysinstall(8): sysinstall changes /etc/rc.conf after i o bin/69723 sysinstall sysinstall(8): [request] allow to continue from packag o bin/62702 sysinstall sysinstall(8): backup of /etc and /root during sysinst o alpha/61940 sysinstall sysinstall(8): Can't disklabel new disk from FreeBSD/a o bin/61890 sysinstall sysinstall(8): fdisk(8) uses incorrect calculations fo o bin/60632 sysinstall sysinstall(8): UI bug in partition label screen in sys o bin/59708 sysinstall sysinstall(8): [patch] add sSMTP support for Mail sele o bin/53341 sysinstall sysinstall(8): [patch] dump frequency in sysinstall is o bin/46905 sysinstall sysinstall(8): FreeBSD 5.x cannot be installed from mu o bin/41949 sysinstall sysinstall(8): sysinstall sorts /etc/rc.conf during ne o bin/41850 sysinstall sysinstall(8): sysinstall fails to create root filesys f bin/40260 sysinstall sysinstall(8): hang when detecting devices (No CD/DVD s conf/39580 sysinstall sysinstall(8): [request] more secure mount options o bin/38056 sysinstall sysinstall(8): User (creation)'s "Member groups" item a bin/32375 sysinstall sysinstall(8): sysinstall doesn't respect User generat s bin/7232 sysinstall sysinstall(8): suggestion for FreeBSD installation dia 54 problems total. From owner-freebsd-sysinstall@FreeBSD.ORG Tue Nov 23 07:08:13 2010 Return-Path: Delivered-To: freebsd-sysinstall@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4329B106566B; Tue, 23 Nov 2010 07:08:13 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 722408FC15; Tue, 23 Nov 2010 07:08:11 +0000 (UTC) Received: by wyb35 with SMTP id 35so100344wyb.13 for ; Mon, 22 Nov 2010 23:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=395Wj8FG18Ka7CU5o5fCeRnipHtD0eNRT8bjMesPsME=; b=Dq6w+4S7j9mmSpaX2TIcIMG/GrPnZ3hpMWK3k5Ei489Vm8+KeR4H3qgU2Ywzroh6w4 /dNhSjM8Ts6bbFsz0SDnyyealcHdJxQv0CGXxNFfyhQx8e/umlpRtj0zP21S9WShNcAZ y19H74TQsLJDiHuvDhTH17TrnUeA5tbzK2sbI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=P3IpeWGfbDOTQd3M+TR+SptAbP59bl3uLrphR7TnjDNAD3/S+BSPQkLMLdIPkjY4h9 zG3GcS6GhE6MIVdkVol+L9INDLtyow8KbsSUI9Dc9iuA8aoHZylwGQED+Y+2eSh1h53n SqysGHUkjMQTwhUk/rap0FuLRmVrmBFo/gebU= MIME-Version: 1.0 Received: by 10.216.46.200 with SMTP id r50mr616179web.45.1290496091024; Mon, 22 Nov 2010 23:08:11 -0800 (PST) Received: by 10.216.198.27 with HTTP; Mon, 22 Nov 2010 23:08:10 -0800 (PST) Date: Mon, 22 Nov 2010 23:08:10 -0800 Message-ID: From: Garrett Cooper To: bug-followup@FreeBSD.org, peter@trumanbrewery.com Content-Type: multipart/mixed; boundary=0016364c7a1316ee150495b3092e Cc: Gavin Atkinson , freebsd-sysinstall@freebsd.org Subject: Re: bin/38854: sysinstall(8): resetting during setup causes the target installation path to change from "/mnt" (new root partition) to "/" (the memory disk) X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 07:08:13 -0000 --0016364c7a1316ee150495b3092e Content-Type: text/plain; charset=ISO-8859-1 Hi, I prototyped up a solution for this issue by banking on the fact that the *fork(2) system calls actually do a copy on write of several process variables, including the current working directory, etc. Example: $ ./test_forking_and_chdiring [0] getwd = /tmp [1] getwd = /usr/home/gcooper [2] getwd = /tmp [3] getwd = /usr/home/gcooper So at least now sysinstall is starting from a sane state consistently, instead of just reexecuting itself via system(3) with -fakeInit and -restart (ugh). I was concerned about sysinstall closing file descriptors on exec, etc, but this appears to be mostly baseless. Cleaning up these dead options should be done in later commits. I executed sysinstall from the command line in multiuser given the following 4 scenarios: 1. Exit (exit code was 0). 2. ^C: a. Continue (process continued as usual). b. Restart (process `restarted' by continuing on in the loop again -- it was rather amusing when I discovered that it reexecutes itself and can essentially overload the stack eventually if it gets into an infinite loop :/). c. Abort (process exited with 1 as I designed it to). There might be some corner cases with usage, but this focuses on the primary areas. I was hoping to use vfork(2) (because it would have made the logic a bit simpler, but unfortunately vfork isn't isolated enough to do proper signal handling with SIGINT (I think that the parent process and the child process share the same signal vectors, but I could be wrong... I should look). Ideally sysinstall should be run from a custom /etc/rc script that sets up all of these variables and ensures that the sysinstall process is playing by the rules, but that's something else that needs to be resolved down the line for this particular issue. This is just a quick and dirty stopgap fix. Credit goes to Gavin for pointing me to this annoying problem :). Thanks, -Garrett #include #include #include #include #include #include int main(void) { int status; switch (fork()) { case -1: err(1, "fork"); case 0: if (chdir("/tmp") == -1) err(1, "chroot"); printf("[0] getwd = %s\n", getwd(NULL)); exit(0); default: if (wait(&status) == -1) err(1, "wait"); else if (status) errx(1, "exit status != 0"); } printf("[1] getwd = %s\n", getwd(NULL)); switch (vfork()) { case -1: err(1, "vfork"); case 0: if (chdir("/tmp") == -1) err(1, "chroot"); printf("[2] getwd = %s\n", getwd(NULL)); exit(0); default: if (wait(&status) == -1) err(1, "wait"); else if (status) errx(1, "exit status != 0"); } printf("[3] getwd = %s\n", getwd(NULL)); exit(0); } --0016364c7a1316ee150495b3092e Content-Type: text/x-patch; charset=US-ASCII; name="bin.38854.patch" Content-Disposition: attachment; filename="bin.38854.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ggufvsd80 SW5kZXg6IHVzci5zYmluL3N5c2luc3RhbGwvc3lzdGVtLmMKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLnNi aW4vc3lzaW5zdGFsbC9zeXN0ZW0uYwkocmV2aXNpb24gMjE1NjYxKQorKysgdXNyLnNiaW4vc3lz aW5zdGFsbC9zeXN0ZW0uYwkod29ya2luZyBjb3B5KQpAQCAtNTgsMjQgKzU4LDEwIEBACiBzdGF0 aWMgaW50CiBpbnRyX3Jlc3RhcnQoZGlhbG9nTWVudUl0ZW0gKnNlbGYpCiB7Ci0gICAgaW50IHJl dCwgZmQsIGZkbWF4OwotICAgIGNoYXIgKmFyZzsKLQogICAgIG1lZGlhQ2xvc2UoKTsKICAgICBm cmVlX3ZhcmlhYmxlcygpOwotICAgIGZkbWF4ID0gZ2V0ZHRhYmxlc2l6ZSgpOwotICAgIGZvciAo ZmQgPSAzOyBmZCA8IGZkbWF4OyBmZCsrKQotCWNsb3NlKGZkKTsKLSAgICAKLSAgICBpZiAoUnVu bmluZ0FzSW5pdCkKLQkgICAgYXJnID0gIi1yZXN0YXJ0IC1mYWtlSW5pdCI7Ci0gICAgZWxzZQot CSAgICBhcmcgPSAiLXJlc3RhcnQiOwotCi0gICAgcmV0ID0gZXhlY2woU3RhcnROYW1lLCBTdGFy dE5hbWUsIGFyZywgTlVMTCk7Ci0gICAgbXNnRGVidWcoImV4ZWNsIGZhaWxlZCAoJXMpXG4iLCBz dHJlcnJvcihlcnJubykpOwotICAgIC8qIE5PVFJFQUNIRUQgKi8KLSA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