From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 29 04:40:00 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 D7E586CC for ; Mon, 29 Oct 2012 04:40:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A81BB8FC14 for ; Mon, 29 Oct 2012 04:40:00 +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 q9T4e0vl069403 for ; Mon, 29 Oct 2012 04:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9T4e0bP069402; Mon, 29 Oct 2012 04:40:00 GMT (envelope-from gnats) Resent-Date: Mon, 29 Oct 2012 04:40:00 GMT Resent-Message-Id: <201210290440.q9T4e0bP069402@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, Alexander Verbod Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50254635 for ; Mon, 29 Oct 2012 04:36:31 +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 34AF28FC14 for ; Mon, 29 Oct 2012 04:36:31 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9T4aUUs062375 for ; Mon, 29 Oct 2012 04:36:30 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9T4aUoq062346; Mon, 29 Oct 2012 04:36:30 GMT (envelope-from nobody) Message-Id: <201210290436.q9T4aUoq062346@red.freebsd.org> Date: Mon, 29 Oct 2012 04:36:30 GMT From: Alexander Verbod To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/173180: freebsd-update(8) wipes system files (file size is zero) and makes the operation system not available either over consoles or network. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 04:40:00 -0000 >Number: 173180 >Category: bin >Synopsis: freebsd-update(8) wipes system files (file size is zero) and makes the operation system not available either over consoles or network. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 29 04:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Alexander Verbod >Release: 9.0-RELEASE >Organization: >Environment: FreeBSD vmfbsd9 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: If FreeBSD installed on a hardware or virtual machines(include VPS{Virtual Private Server}) with RAM memory equal 128Mb or less freebsd-update(8) corrupts files in system directories /bin, /lib, reboot OS without any confirmation and upon start up freeze up OS because of most important files in the /bin and /lib directories are zero size, which makes system not accessible from any consoles and over network. Final result of binary upgrade will be unrecoverable system in case of installation was done on a VPS with an external provider. The only access is via single mode, but since most important programs and libraries are absent, /rescue isn't a helper, especially after someone removed nc(1) from /rescue on the FreeBSD 9 (BTW, /rescue/rcp isn't work too, and will say that it can't start under user 0. I'll supply additional PR on it.) Screen shots made in single mode attached: http://s17.postimage.org/gbi9bp4n3/001_host_under_KVM.jpg http://s10.postimage.org/6f9ly4mvd/002_attempt_to_run_freebsd_update_install_after.jpg http://s10.postimage.org/mws0b9xvt/003_freebsd_update_IDS.jpg http://s11.postimage.org/4uzcjsp1v/004_attempt_to_run_netif_start.jpg http://s10.postimage.org/8ixtb0qtl/005_root_bin.jpg http://s13.postimage.org/sz4jigw7b/006_root_lib.jpg http://s12.postimage.org/3naue308t/007_system_isnot_overfilled_df.jpg http://s11.postimage.org/t96tix0wj/008_UNAME_after_reboot.jpg http://s8.postimage.org/4dizmrdj9/100_host_under_Virtual_Box_after_reboot.png >How-To-Repeat: It can be absolutely fresh installed system with default settings, without any additional software installed. The only sshd(8) service is activated. Issue easily repeated under any virtual machines or on a VPS (it was first detected on VPS based on QEMU-KVM, then tested on XEN and tested also under VirtualBox) platforms that provided resources for the FreeBSD guest OS. Maximum available RAM(Random Access Memory)memory is equal to 128 Mb. Swap size is 153Mb, which was set by FreeBSD installer as default auto-configured option. After this issue was discovered, we tried to setup the same system with 384Mb swap, but it doesn't help too. Hard drive space isn't an issue since on a moment of attempt to upgrade and after there are more then 1 Gigabytes of free space, so for a test it is enough to setup 3Gb HDD space. To reproduce an issue run standard recommended sequence described here: http://lists.freebsd.org/pipermail/freebsd-stable/2012-October/069998.html freebsd-update upgrade -r 9.1-RC2 freebsd-update install shutdown -r now freebsd-update install After the last step, a system will self reboot and never back online. >Fix: Do not use freebsd-update(8) until it will be fixed(at least on VPS with a low memory). ======================= For those who get this issue and need to save important files before initiating re-installation use command sequence described in attachment Patch attached with submission follows: # Run system in single mode and do /rescue/mount -u / /rescue/mount -a -o rw /rescue/ifconfig lo0 up /rescue/ifconfig lo0 inet 127.0.0.1 netmask 0xff000000 /rescue/ifconfig em0 up # <- replace em0 with your interface /rescue/ifconfig em0 inet IP.OF.YOUR.VPS netmask 0xffffff00 ### Replace em0 to your type of interface and ### IP.OF.YOUR.VPS above to your VPS's IP /rescue/route -v add default IP.OF.YOUR.VPS-default-gateway ### Replace IP.OF.YOUR.VPS-default-gateway above to your VPS's GateWay /rescue/hostname FQDN_of_VPS # Replace FQDN_of_VPS to your FQDN /rescue/ping -c 3 google.com # Test that you got online # Add user 0 (Zero) to the system (with uid=0 and gid=0) # because /rescue/rpc will refuse to work on broken system # since it can't get 'root' name /usr/sbin/adduser # Use then /rescue/rpc to safe importunt files to remote machine. >Release-Note: >Audit-Trail: >Unformatted: