Suspend/Resume during LiveCD session changes hardware clock

Bug #312486 reported by Geir Ove Myhr
4
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: acpi-support

When using a Ubuntu LiveCD (i.e. choosing "Try Ubuntu without any changes to your computer" from the boot menu) on a computer where the hardware clock is set to timezone different from UTC, there is an active internet connection and the computer is suspended to memory and resumed at least once, the hardware clock is changed. This results in a wrong system time when the computer is booted into the installed operating system (whether Windows or Linux). This is disappointing since "without any changes to your computer" was chosen at boot time.

I discovered this using Jaunty alpha-2, but I could also reproduce it with Hardy 8.04.1.

Example: The time is around 10:48 AM EST, when the computer is booted using the LiveCD, which sets the time zone to UTC automatically.
ubuntu@ubuntu:~$ sudo hwclock --show
Tue 30 Dec 2008 10:48:27 AM UTC -0.835046 seconds
ubuntu@ubuntu:~$ date
Tue Dec 30 10:48:29 UTC 2008

Now, wireless network is selected (this synchronizes the system clock to have a correct UTC time)
ubuntu@ubuntu:~$ sudo hwclock --show
Tue 30 Dec 2008 10:49:16 AM UTC -0.534459 seconds
ubuntu@ubuntu:~$ date
Tue Dec 30 15:49:17 UTC 2008

Then, a suspend and resume cycle, and the hardware clock is set.
ubuntu@ubuntu:~$ sudo hwclock --show
Tue 30 Dec 2008 03:51:35 PM UTC -0.565752 seconds
ubuntu@ubuntu:~$ date
Tue Dec 30 15:51:37 UTC 2008

I don't worry that the time zone is set to UTC in the LiveCD environment, but that the hardware is clock is changed so that the installed software gets confused.

Use case 1:
Peter uses Windows XP. He is thrilled that he gets the option to try Ubuntu without any changes to his computer. Later that day he is doing some work in Windows before a date with his girfriend at 7 pm. Unfortunately, the Windows system time is now 1 hour behind, so he is an hour late for his date.

Use case 2:
John asks a friend if he can borrow his computer to check if a suspend/resume bug can be reproduced on that hardware. He says that he can run linux on the computer without changing anything, but does not know that his testing will leave the computer with a wrong system time afterwards.

Related branches

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Committed changes to stop synchronising the system and hardware clocks over a suspend/resume cycle, which will be released with acpi-support 0.120 in jaunty.

The rationale is that the kernel records the delta between the two clocks on suspend, and resets the system clock on resume based on this delta. The mix of the two can lead to strange issues such as you've seen.

We now just let the kernel do its thing.

Changed in acpi-support:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package acpi-support - 0.120

---------------
acpi-support (0.120) jaunty; urgency=low

  [ Alexander Solodukhin ]
  * Correct suspend.d/55-down-interfaces.sh to point to
    /var/run/network/ifstate rather than /etc/network/run/ifstate.
    LP: #295544.

  [ Martin Pitt ]
  * Drop lib/*.config: I committed all sleep quirks to hal-info now
    (upstream, and in Jaunty). The ACPI_SLEEP whitelisting, as well as
    acpi-support's suspend/resume handling itself is not used by
    default any more, and almost all laptops support suspend/resume
    nowadays, so keeping a whitelist is the wrong approach.
    LP: #37303, #44781.
  * lib/device-funcs: Drop reading of .config files.
  * Drop vbesave, resume.d/17-video-restore.sh, suspend.d/
    80-video-pci-state.sh, suspend.d/80-video-vesa-state.sh:
    pm-utils and hal-info handle VBE/PCI status quirks.

  [ Scott James Remnant ]
  * suspend.d/88-time.sh, resume.d/50-time.sh: Remove since the kernel
    keeps the system clock in sync with the hardware clock over a
    suspend/resume cycle. LP: #312486, #218120, #158358, #157936.
  * debian/preinst: Remove on upgrade.
  * Remove the toshiba_acpi.modprobe file; this sets a kernel option that's
    been the default for ages.

 -- Scott James Remnant <email address hidden> Tue, 03 Mar 2009 17:29:01 +0000

Changed in acpi-support:
status: Fix Committed → Fix Released
Ram (rgkrishn)
Changed in acpi-support (Ubuntu):
status: Fix Released → Incomplete
Revision history for this message
Ram (rgkrishn) wrote :

This happens with Live CD 9.10.
I have LiveCD 9.10 in a USB drive and a PC with windows in HD.

When I boot from LiveCD 9.0 USB drive the date/time in UI is fine - date command in shell is fine.

However, after I shutdown the PC (ie. LiveCD 9.10 OS)
and then remove the LiveCD 9.10 USB drive
and boot the PC from its hard disk OS (winXP) I find that the system time is 8 hours ahead of PST (ie UTC)
and this time change shows up in bios setting itself when the PC is booted

This is a pain because once the system boots into windows with wrong time
and then I change time within windows I cannot do any internet work
 (some windows or Mcafee issue I need to figure out) and I have to reboot the system
to get things going.

Revision history for this message
Steve Langasek (vorlon) wrote :

The problem you're seeing is unrelated to this bug report. Please file a new bug.

Changed in acpi-support (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.