Received: from eggs.gnu.org ([208.118.235.92]:37532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO8nl-0006e4-6F for qemu-devel@nongnu.org; Tue, 16 Oct 2012 11:11:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TO8na-0002TQ-Ld for qemu-devel@nongnu.org; Tue, 16 Oct 2012 11:11:25 -0400 Received: from indium.canonical.com ([91.189.90.7]:36415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO8na-0002T3-GP for qemu-devel@nongnu.org; Tue, 16 Oct 2012 11:11:14 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1TO8nZ-000058-P1 for ; Tue, 16 Oct 2012 15:11:13 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B456A2E807C for ; Tue, 16 Oct 2012 15:11:13 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 16 Oct 2012 15:01:16 -0000 From: Lucas Meneghel Rodrigues Sender: bounces@canonical.com References: <20120928172131.28971.43057.malonedeb@wampee.canonical.com> Message-Id: <20121016150120.15447.47293.malone@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1058225] Re: When setting hardware clock on linux guest, hwclock shows crazy date (in the year 2043) Reply-To: Bug 1058225 <1058225@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Paolo fixed the problem with upstream commit: commit b6db4aca20e9af4f62c9c9e08b9b9672a6ed3390 Author: Paolo Bonzini Date: Mon Oct 1 14:22:06 2012 +0200 rtc: fix overflow in mktimegm = When setting a date in 1980, Linux is actually disregarding the century byte and setting the year to 2080. This causes a year-2038 overflow in mktimegm. Fix this by doing the days-to-seconds computation in 64-bit math. = Reported-by: Lucas Meneghel Rodrigues Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori Confirmed that problem is solved. Closing bug. ** Changed in: qemu Status: New =3D> Confirmed ** Changed in: qemu Status: Confirmed =3D> Fix Committed -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1058225 Title: When setting hardware clock on linux guest, hwclock shows crazy date (in the year 2043) Status in QEMU: Fix Committed Bug description: Very easy to reproduce: 1) Build the latest qemu.git (we've captured this on internal automated testing, verified manually), the commit for reference is: 14:07:02 INFO | git commit ID is 6f8fd2530e9a530f237240daf1c981fa5df7f978 (tag v1.2.0-461-g6f8fd25) 2) Install a linux guest in it (caught with RHEL 6.2, verified with Fedora 17) 3) In the linux guest, set the hardware clock with hwclock: /sbin/hwclock --set --date "2/2/80 03:04:00" 4) Verify if hardware clock was set back to the eighties: LC_ALL=3DC /sbin/hwclock 5) Observe amazed that hwclock reports a date in the year 2043: 14:09:34 INFO | ('hwclock', 'FAIL', 2, "Failed to set hwclock back to the eighties. Output of hwclock is 'Sun Dec 27 20:35:46 2043 -0.489664 seconds'") To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1058225/+subscriptions