System time drifts when idle

Bug #620455 reported by bandini
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linux
Invalid
Undecided
Unassigned
linux (Ubuntu)
Expired
High
Unassigned

Bug Description

It seems the system time stops when my notebook goes idle.
By idle, I don't mean suspend or screen lock. But this is best described by the following script :

#!/bin/bash
# set hwclock to system clock to start
# the log file with the same time
hwclock -w
#start with a fresh logfile
touch clocktest.log
echo START > clocktest.log
while [[ true ]]
do
 systime=$(date)
 hwtime=$(hwclock -r)
 echo "$systime | $hwtime" >> clocktest.log
 sleep 20
done

Expected output :
On each line, the system time should be roughly the same. Time delta between each line should be
around 20 seconds

Observed output :
Sorry for the 80 character column wrap. See the edited clocktest.log
for a cleaner ouput.
Look at the following logfile :
START
jeudi 19 août 2010, 15:09:43 (UTC+0200) | jeu. 19 août 2010 15:09:44 CEST -0.500555 secondes
jeudi 19 août 2010, 15:10:04 (UTC+0200) | jeu. 19 août 2010 15:10:05 CEST -1.001562 secondes
jeudi 19 août 2010, 15:10:25 (UTC+0200) | jeu. 19 août 2010 15:10:26 CEST -0.985944 secondes
jeudi 19 août 2010, 15:10:46 (UTC+0200) | jeu. 19 août 2010 15:15:46 CEST -0.032792 secondes <-- 5 minute lag !
jeudi 19 août 2010, 15:11:06 (UTC+0200) | jeu. 19 août 2010 15:16:07 CEST -0.985926 secondes
jeudi 19 août 2010, 15:11:27 (UTC+0200) | jeu. 19 août 2010 15:16:28 CEST -1.001539 secondes
jeudi 19 août 2010, 15:11:48 (UTC+0200) | jeu. 19 août 2010 15:16:49 CEST -0.985969 secondes
jeudi 19 août 2010, 15:12:09 (UTC+0200) | jeu. 19 août 2010 15:17:10 CEST -0.985977 secondes
jeudi 19 août 2010, 15:12:30 (UTC+0200) | jeu. 19 août 2010 15:17:31 CEST -1.001544 secondes
jeudi 19 août 2010, 15:12:51 (UTC+0200) | jeu. 19 août 2010 15:17:52 CEST -0.985920 secondes
jeudi 19 août 2010, 15:13:12 (UTC+0200) | jeu. 19 août 2010 15:18:13 CEST -0.985939 secondes
jeudi 19 août 2010, 15:13:33 (UTC+0200) | jeu. 19 août 2010 15:18:34 CEST -1.001581 secondes
jeudi 19 août 2010, 15:13:54 (UTC+0200) | jeu. 19 août 2010 15:18:55 CEST -0.985917 secondes
jeudi 19 août 2010, 15:14:15 (UTC+0200) | jeu. 19 août 2010 15:29:15 CEST -0.079685 secondes <-- add another 10 minute
jeudi 19 août 2010, 15:14:35 (UTC+0200) | jeu. 19 août 2010 15:29:36 CEST -1.001568 secondes
jeudi 19 août 2010, 15:14:56 (UTC+0200) | jeu. 19 août 2010 15:29:57 CEST -0.985952 secondes

As you can see, after 20 minutes without touching the computer, the system time is late by 15 minutes.

It did not happen with an ubuntu 8.04 kernel ie 2.6.24-28, so I said it was a regression when asked by ubuntu-bug
It has indirect security consequences, because for example after these 20 minutes, I was still able to sudo without being asked
for a password. Screen locking does not happen

The script must be run with sudo because of hwclock

This is an Amilo Xi 2550 notebook.

WORKAROUND: processor.max_cstate=1

WORKAROUND: nohz=off

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: linux-image-2.6.32-24-generic 2.6.32-24.39 [modified: lib/modules/2.6.32-24-generic/kernel/drivers/usb/serial/cp210x.ko]
Regression: Yes
Reproducible: Yes
ProcVersionSignature: Ubuntu 2.6.32-24.39-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic i686
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
Architecture: i386
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: cynove 1823 F.... pulseaudio
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1:
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xf0800000 irq 22'
   Mixer name : 'Realtek ALC883'
   Components : 'HDA:10573055,10573055,00100700 HDA:10ec0883,17341238,00100002'
   Controls : 29
   Simple ctrls : 18
Card1.Amixer.info:
 Card hw:1 'HDMI'/'HDA ATI HDMI at 0xcfeec000 irq 17'
   Mixer name : 'ATI R6xx HDMI'
   Components : 'HDA:1002aa01,00aa0100,00100000'
   Controls : 5
   Simple ctrls : 2
Date: Thu Aug 19 15:23:03 2010
HibernationDevice: RESUME=UUID=d8f0ebc9-37f3-4cdb-aca7-44a4bc42c13e
MachineType: FUJITSU SIEMENS AMILO Xi 2550
ProcCmdLine: root=UUID=d6f01bdd-8503-4992-bc4e-a511f74318fb ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=fr_FR.utf8
 SHELL=/bin/bash
RelatedPackageVersions: linux-firmware 1.34.1
SourcePackage: linux
dmi.bios.date: 03/05/2008
dmi.bios.vendor: Phoenix
dmi.bios.version: 1.11C
dmi.board.name: F44
dmi.board.vendor: FUJITSU SIEMENS
dmi.board.version: 00030D0055014B3C
dmi.chassis.type: 10
dmi.chassis.vendor: FUJITSU SIEMENS
dmi.modalias: dmi:bvnPhoenix:bvr1.11C:bd03/05/2008:svnFUJITSUSIEMENS:pnAMILOXi2550:pvr:rvnFUJITSUSIEMENS:rnF44:rvr00030D0055014B3C:cvnFUJITSUSIEMENS:ct10:cvr:
dmi.product.name: AMILO Xi 2550
dmi.sys.vendor: FUJITSU SIEMENS

Revision history for this message
bandini (jphilippe-francois) wrote :
Revision history for this message
bandini (jphilippe-francois) wrote :
Revision history for this message
bandini (jphilippe-francois) wrote :

Since the 80 column wrap made my two column output look wrong, here is an edited log

description: updated
Revision history for this message
bandini (jphilippe-francois) wrote :

Bug reproduced with 2.6.32-02063219-generic

Revision history for this message
bandini (jphilippe-francois) wrote :

Bug reproduced with 2.6.36-rc1

tags: removed: needs-upstream-testing
Revision history for this message
Billy (lacky111) wrote :

Have you tried to boot with kernel parameter:

processor.max_cstate=1

Revision history for this message
bandini (jphilippe-francois) wrote :

I just tried, and it indeed works around the bug.

The bug also disappear when booting with nohz=off

Revision history for this message
Billy (lacky111) wrote :

Please add the output of

cat /proc/acpi/processor/CPU0/power
and
grep . -r /sys/devices/system/cpu/cpu0/cpuidle/

with/without nohz=off option.

Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

bandini, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command in the development release from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux <replace-with-bug-number>

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.

Please let us know your results. Thanks in advance.

description: updated
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
tags: added: needs-upstream-testing
Revision history for this message
bandini (jphilippe-francois) wrote :

It is fixed upstream, ie I can boot a mainline 3.4.2 kernel without nohz=off command line, and the clock does not drift.

tags: added: kernel-fixed-upstream
removed: needs-upstream-testing
Revision history for this message
penalvch (penalvch) wrote :

Marking Triaged Medium as mainline tested and this bug being an essential functionality of an application that is ineffective (keeping accurate time).

Changed in linux (Ubuntu):
importance: Undecided → High
status: Incomplete → Triaged
Changed in linux:
status: New → Invalid
Revision history for this message
penalvch (penalvch) wrote :

bandini, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Please do not test the daily kernel folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.12-rc2

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.

Changed in linux (Ubuntu):
status: Triaged → Incomplete
penalvch (penalvch)
tags: added: bios-outdated-1.15c
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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