awk errors and invalid /etc/default/adjtimex

Bug #553237 reported by Savvas Radevic
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
adjtimex (Debian)
Fix Released
Unknown
adjtimex (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Update:
Please read comments #11 and #12 below:
https://bugs.launchpad.net/ubuntu/+source/adjtimex/+bug/553237/comments/11
https://bugs.launchpad.net/ubuntu/+source/adjtimex/+bug/553237/comments/12

Binary package hint: adjtimex
Package version: 1.28-1

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu lucid (development branch)
Release: 10.04
Codename: lucid

Bug report exists for debian too: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557949

I have the same problem on Ubuntu 10.04 (lucid, still under testing).
This error makes this package unusable.

It looks like that "Correctly apply +-500 ppm sanity check" applied for version 1.28 is causing problems.
Also, bug #559882 ( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559882 ) seems to be a duplicate of this one.

I have the same problem:

$ sudo aptitude install adjtimex
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following NEW packages will be installed:
  adjtimex
0 packages upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0B/58.2kB of archives. After unpacking 176kB will be used.
Writing extended state information... Done
Preconfiguring packages ...
Selecting previously deselected package adjtimex.
(Reading database ... 167625 files and directories currently installed.)
Unpacking adjtimex (from .../adjtimex_1.28-1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up adjtimex (1.28-1) ...
update-rc.d: warning: adjtimex start runlevel arguments (S) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: adjtimex stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Regulating system clock...done.
Comparing clocks (this will take 70 sec)...done.
awk: BEGIN{print ((to-10000)*100 + override)./65536.)*.0864}
awk: ^ syntax error
awk: BEGIN{print ((to-10000)*100 + override)./65536.)*.0864}
awk: ^ unterminated regexp
awk: cmd. line:1: BEGIN{print ((to-10000)*100 + override)./65536.)*.0864}
awk: cmd. line:1: ^ unexpected newline or end of string
Adjusting system time by sec/day to agree with CMOS clock...done.

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done

$ sudo adjtimex --adjust
                                      --- current --- -- suggested --
cmos time system-cmos error_ppm tick freq tick freq
1270121506 -124.142183
1270121516 -123.957160 18502.3 10000 0
1270121526 -123.772238 18492.2 10000 0 9815 511312
1270121536 -123.571375 20086.3 10000 0 9799 897037
1270121546 -123.386457 18491.8 10000 0 9815 537875

ERROR: required correction is greater than plus/minus 500 parts
per million, quitting (use --force-adjust to override).

$ sudo adjtimex --adjust --force-adjust
                                      --- current --- -- suggested --
cmos time system-cmos error_ppm tick freq tick freq
1270121703 -120.372324
1270121713 -120.187284 18504.0 10000 0
1270121723 -119.986438 20084.6 10000 0 9799 1009537
1270121733 -119.801500 18493.8 10000 0 9815 406625
1270121743 -119.596560 20494.0 10000 0 9795 392687

WARNING: required correction is greater than plus/minus 500 parts
per million, but adjusting anyway per your request.
1270121753 -119.627563 -3100.3 9795 392687 9826 412337
1270121763 -119.639954 -1239.1 9795 392687 9807 2955737
1270121773 -119.652301 -1234.7 9795 392687 9807 2666674

WARNING: required correction is greater than plus/minus 500 parts
per million, but adjusting anyway per your request.

Revision history for this message
Savvas Radevic (medigeek) wrote :

current workaround is to install the older package 1.27 from ubuntu karmic 9.10:
64-bit: http://packages.ubuntu.com/karmic/amd64/adjtimex/download
32-bit: http://packages.ubuntu.com/karmic/i386/adjtimex/download

description: updated
Changed in adjtimex (Debian):
status: Unknown → New
Revision history for this message
Savvas Radevic (medigeek) wrote :

I created this patch, it helps to:
- override the limit when adjtimexconfig is executed
- send the warnings to standard error (stderr)

Test buildlog: http://launchpadlibrarian.net/42809049/buildlog_ubuntu-lucid-amd64.adjtimex_1.28-1ubuntu1_FULLYBUILT.txt.gz

Revision history for this message
Charlie_Smotherman (cjsmo) wrote :

I'm not seeing the described behavior, could you please recheck to see if this is still a problem

charlie@charlie-laptop:~$ sudo apt-get install adjtimex
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  adjtimex
Need to get 56.4kB of archives.
After this operation, 176kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/universe adjtimex 1.28-1 [56.4kB]
Fetched 56.4kB in 1s (43.7kB/s)
Preconfiguring packages ...
Selecting previously deselected package adjtimex.
(Reading database ... 127452 files and directories currently installed.)
Unpacking adjtimex (from .../adjtimex_1.28-1_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up adjtimex (1.28-1) ...
update-rc.d: warning: adjtimex start runlevel arguments (S) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: adjtimex stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Regulating system clock...done.
Comparing clocks (this will take 70 sec)...done.
Adjusting system time by 20.7951 sec/day to agree with CMOS clock...done.

charlie@charlie-laptop:~$ sudo adjtimex --adjust
                                      --- current --- -- suggested --
cmos time system-cmos error_ppm tick freq tick freq
1270551481 1.654814
1270551491 1.657096 228.2 10002 2666237
1270551501 1.659332 223.6 10002 2666237 10000 1118750
1270551511 1.661658 232.6 10002 2666237 10000 529687
1270551521 1.663852 219.4 10002 2666237 10000 1395312
1270551531 1.664079 22.7 10000 1395312 9999 6461412
1270551541 1.664040 -3.9 10000 1395312 10000 1649999
1270551551 1.664139 9.9 10000 1395312 10000 746875
charlie@charlie-laptop:~$

Changed in adjtimex (Ubuntu):
status: New → Incomplete
Revision history for this message
Savvas Radevic (medigeek) wrote :

Hm.. thanks, I can't confirm it anymore! Give me 48 hours (2 days) to check if this happens while leaving the computer on. I really hope this is just a one-time bug.

I don't understand completely how it works, but I think it doesn't happen to all machines. I'm not the only one that has this problem -- 2 other people have confirmed the same problem.
You can see the bug report at debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557949

Revision history for this message
Bret Towe (magnade) wrote :

I'm seeing it here still
I notice that the original reporter has an amd64 system same as I
and the working comment above is a i386 system

Revision history for this message
Savvas Radevic (medigeek) wrote :
Download full text (4.5 KiB)

Bret, try these packages:
64-bit: https://launchpad.net/~medigeek/+archive/experimental/+files/adjtimex_1.28-1ubuntu1_amd64.deb
32-bit: https://launchpad.net/~medigeek/+archive/experimental/+files/adjtimex_1.28-1ubuntu1_i386.deb

It still happens. I have no idea what triggers it, but the sanity check is to blame.

Here's my command log:
$ sudo rm /etc/default/adjtimex

$ sudo adjtimexconfig
Comparing clocks (this will take 70 sec)...done.
awk: BEGIN{print ((to-10000)*100 + override)./65536.)*.0864}
awk: ^ syntax error
awk: BEGIN{print ((to-10000)*100 + override)./65536.)*.0864}
awk: ^ unterminated regexp
awk: cmd. line:1: BEGIN{print ((to-10000)*100 + override)./65536.)*.0864}
awk: cmd. line:1: ^ unexpected newline or end of string
Adjusting system time by sec/day to agree with CMOS clock...done.

$ cat /etc/default/adjtimex
# /etc/default/adjtimex - configuration file for adjtimex(8)
#
# you may adjust these values manually or by calling /usr/sbin/adjtimexconfig
#
# This file is sourced by /etc/init.d/adjtimex
#
TICK=to
FREQ=override).

$ sudo aptitude purge adjtimex
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages will be REMOVED:
  adjtimex{p}
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 176kB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
(Reading database ... 197728 files and directories currently installed.)
Removing adjtimex ...
Purging configuration files for adjtimex ...
removing debconf db entries
removed debconf db entries
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done

$ sudo aptitude clean
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

$ sudo apt-get install adjtimex
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  adjtimex
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.2kB of archives.
After this operation, 176kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ lucid/universe adjtimex 1.28-1 [58.2kB]
Fetched 58.2kB in 26s (2,219B/s)
Preconfiguring packages ...
Selecting previously deselected package adjtimex.
(Reading database ... 197718 files and directories currently installed.)
Unpacking adjtimex (from .../adjtimex_1.28-1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up ...

Read more...

Changed in adjtimex (Ubuntu):
status: Incomplete → New
Revision history for this message
Savvas Radevic (medigeek) wrote :

With my package (1.28-1ubuntu1):
$ sudo adjtimexconfig
Comparing clocks (this will take 70 sec)...
WARNING: required correction is greater than plus/minus 500 parts
per million, but adjusting anyway per your request.
done.
Adjusting system time by -905.567 sec/day to agree with CMOS clock...done.

$ sudo adjtimex --adjust
                                      --- current --- -- suggested --
cmos time system-cmos error_ppm tick freq tick freq
1270640952 -39.632528
1270640962 -39.631527 100.1 9898 5032824
1270640972 -39.651491 -1996.4 9898 5032824 9918 4796762
1270640982 -39.650573 91.8 9898 5032824 9897 5570799
1270640992 -39.649676 89.7 9898 5032824 9897 5708299
1270641002 -39.664582 -1490.6 9897 5708299 9912 5091799
1270641012 -39.663707 87.5 9897 5708299 9896 6527524
1270641022 -39.683741 -2003.4 9897 5708299 9917 5931611

ERROR: required correction is greater than plus/minus 500 parts
per million, quitting (use --force-adjust to override).

Revision history for this message
Savvas Radevic (medigeek) wrote :

Sorry for triple-posting. My motherboard is MSI P965 Neo2 if it matters:
http://www.msi.com/index.php?func=proddesc&maincat_no=1&prod_no=1163

Revision history for this message
Savvas Radevic (medigeek) wrote :

Re-confirming once more. To clear out suspicion, the time drifting / shifting problem I'm having is a long-standing bug:
https://bugs.launchpad.net/bugs/104091

Revision history for this message
Bret Towe (magnade) wrote :

Savvas,
I tried your 64bit package and it does put numbers in the /etc/default/adjtimex file
and I didn't see any of the awk errors

on a side note I've found i have to disable cpu frequency scaling first to get a proper
sampling of my clock skew
without that what it gets can vary alot on each run

Revision history for this message
Savvas Radevic (medigeek) wrote : Re: [Bug 553237] Re: awk errors and invalid /etc/default/adjtimex

> on a side note I've found i have to disable cpu frequency scaling first to get a proper
> sampling of my clock skew
> without that what it gets can vary alot on each run

hm.. that cpu frequency comment makes me wonder, because I think I
have spread spectrum enabled, and probably that is what causes my
clock to shift so much:
http://lkml.indiana.edu/hypermail/linux/kernel/0410.1/1505.html
http://ubuntuforums.org/showthread.php?t=956263

"Otherwise, reboot your system and enter BIOS SETUP. Check if your
BIOS has a Front Side Bus (FSB) Spread Spectrum (SS) clocking option.
On many systems, this option is located in the "Advanced Chipset
Features" menu. If the option is present and enabled, disable it.
Boot Linux and observe the system clock over several hours to verify
if this has improved its accuracy."

I will disable:
- Spread spectrum
- D.O.T. (Dynamic Overclocking Technology)

I will purge:
- ntp
- adjtimex

I will leave the pc running for a while and let you know of my
results. Thanks for this lovely side note! :)

Revision history for this message
Bret Towe (magnade) wrote :

Spread Spectrum I'm rather certain that it is disabled for me
so all I have is the amd powernow and c1e support enabled
but like I said I disabled the powernow in software to force
cpus to max speed and stay and then ran adjtimex
the first 3 samples (running it manually at the time)
were jumpy but after that it stabilized and got a good number

ntp now i think is showing in the drift file 0.600 or so
it was complaining about over 500ppm before it was adjusted
and this is with powernow and c1e enabled

Revision history for this message
Savvas Radevic (medigeek) wrote :

Well... problem solved! I will set this bug as invalid. :)
The spread spectrum and/or that dynamic overclock technology was to blame.

Changed in adjtimex (Ubuntu):
status: New → Invalid
description: updated
Revision history for this message
Bret Towe (magnade) wrote :

good to hear
looks like a dup has appeared on the awk related bug
https://bugs.launchpad.net/ubuntu/+source/adjtimex/+bug/555761

Changed in adjtimex (Debian):
status: New → Fix Released
Revision history for this message
Leo Howell (leo-lwh) wrote :

Not sure this should be marked invalid since the awk error is real, and the ubuntu version of the package still has the bug.

Revision history for this message
Savvas Radevic (medigeek) wrote :

Hm.. true -- even though I fixed my problem due to a hardware setting, the package itself seems problematic. Should I set it back to New/Confirmed?

Revision history for this message
Leo Howell (leo-lwh) wrote :

I think that would be reasonable (although I'm not an expert on the process here)

Changed in adjtimex (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
David Futcher (bobbo) wrote :

Debian bug tracker reports this fixed in the package version that's hit Maverick and I can no longer reproduce this bug. I am therefore marking this as "Fix Released". If this is still an issue for anyone, feel free to re-open the bug. Thanks!

Changed in adjtimex (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Savvas Radevic (medigeek) wrote :

I can confirm it's fixed. Can someone unsubscribe the ubuntu review team, since the team is not required anymore? :)

Revision history for this message
Savvas Radevic (medigeek) wrote :

err.. that is, the team's approval :)

Revision history for this message
Paul Beardsell (paul-beardsell) wrote :

This bug is not fixed. Upon install of adjtimex I experienced the awk errors reported above by others. You can avoid seeing the awk errors if you fix some BIOS flag, we're told. That's a *different* problem you've fixed, that just suppresses the symptom. The awk error still exists. adjtimex does not work out of the box. Currently the only easy workaround to the awk error is to install karmic's version of the package. Neither that nor the BIOS tinkering is for the ordinary Ubuntu user. This bug still exists. Please re-open.

Revision history for this message
Savvas Radevic (medigeek) wrote :

On 23 September 2010 03:35, Paul Beardsell <email address hidden> wrote:

> This bug is not fixed.
>

Paul, did you by any chance try Ubuntu 10.10 and the adjtimex version
1.29-2?
http://mirrors.kernel.org/ubuntu/pool/universe/a/adjtimex/adjtimex_1.29-2_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/a/adjtimex/adjtimex_1.29-2_i386.deb

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.