[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ntp-bugs
Subject:    [ntp:bugs] [Bug 2191] New: dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make check
From:       bugzilla-daemon () ntp ! org
Date:       2012-05-22 23:03:31
Message-ID: bug-2191-35 () http ! bugs ! ntp ! org/
[Download RAW message or body]

https://bugs.ntp.org/show_bug.cgi?id=2191

             Bug #: 2191
           Summary: dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make
                    check
           Product: ntp
           Version: 4.2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: refclock - parse
        AssignedTo: rc-parse@ntp.org
        ReportedBy: hart@ntp.org
                CC: bugs@ntp.org
    Classification: Unclassified


Before I dig into specifics, a more general question comes to the fore:  Why is
dcfd.c distributed in our tarballs?  It appears to be an alternative to ntpd in
that it can discipline the system clock to a reference clock.  If there is a
constituency of dcfd users, doesn't it deserve its own distribution tarball and
maintainers?  It seems the easiest way to handle this issue would be to remove
dcfd from the NTP distribution.


[davehart@sterling ~]$ uname -a
Linux sterling.ad.hartbrothers.com 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16
00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux
[davehart@sterling ~]$ lsb_release -a
LSB Version:   
> core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
> 
Distributor ID: CentOS
Description:    CentOS release 6.2 (Final)
Release:        6.2
Codename:       Final


make  check-local
make[4]: Entering directory
`/home/davehart/ntp-4.2.7p276/A.x86_64-unknown-centos6.2/parseutil'
case "testdcf dcfd" in  \
         *dcfd*) ./dcfd -Y ;;           \
        esac
  starting year 1998
  ending year   3100
2098: dcf_to_unixtime(1998,0) FAILURE: was=883612800 s/b=4039372800 
(-3155760000)
make[4]: *** [check-local] Error 1

config.h has:
#define SIZEOF_CHARP 8
#define SIZEOF_INT 4
#define SIZEOF_LONG 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF_PTHREAD_T 8
#define SIZEOF_SHORT 2
#define SIZEOF_SIGNED_CHAR 1
#define SIZEOF_TIME_T 8

The code in question starting at dcfd.c:1328 calculates an unexpected time_t
value and prints the error message.  As a secondary issue, the diagnostic
printf's last argument looks wrong to me:

        fprintf( stdout, 
"%04d: dcf_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu  (%ld)\n",
           year, (int)ct.year, (int)Flag, 
           (unsigned long)Observed, (unsigned long)Expected,
           ((long)Observed - (long)Expected) );

If sizeof(long) < sizeof(time_t) it would be better to subtract first and cast
the result, wouldn't it?

-- 
Configure bugmail: https://bugs.ntp.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
bugs mailing list
bugs@lists.ntp.org
http://lists.ntp.org/listinfo/bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic