Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2001 01:36:14 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        hackers@FreeBSD.org
Subject:   Re: Ok, who broke timed?
Message-ID:  <20011120003613.GA29465@student.uu.se>
In-Reply-To: <XFMail.011119150628.jhb@FreeBSD.org>
References:  <XFMail.011119150628.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 19, 2001 at 03:06:28PM -0800, John Baldwin wrote:
> Does timed have some major 64 bit issues or something?  Trying to run timed on
> my 5.0 alpha from a 4.4 x86 box proves disastrous.  5.0 x86 clients work fine. 
> The alpha keeps getting its date set back into 1970:

After quick look at the source I would say that timed has some major 64
bit issues.  
As far as I can tell timed sends/receives a 'struct tsp' after
adjusting it for byteorder but not for wordsize.  This struct is
defined in <protocols/timed.h> as

struct tsp {
        u_char  tsp_type;
        u_char  tsp_vers;
        u_short tsp_seq;
        union {
                struct timeval tspu_time;
                char tspu_hopcnt;
        } tsp_u;
        char tsp_name[MAXHOSTNAMELEN];
};

and struct timeval is defined in <sys/time.h> as

struct timeval {
        long    tv_sec;         /* seconds */
        long    tv_usec;        /* and microseconds */
};


Since 'long' is 32-bit on x86 and 64-bits on Alpha this means that
"interesting" things seem likely to happen if one tries to send a
'long' between machines when they don't agree on how large a 'long' is.





> 
> Nov 19 14:06:02 baz timed[379]: slave to in.cx
> Jan  2 21:35:41 baz timed[379]: date changed by in.cx from Mon Nov 19 14:06:02
> 2001
> 19 Nov 14:07:49 ntpdate[533]: step time server 216.34.144.7 offset
> 1006002718.410080 sec
> 
> (I ran ntpdate manually after killing timed.)
> 
> On x86 the messages look like so:
> 
> Nov 19 13:14:05 deimos timed[425]: slave to server.baldwin.cx
> Nov 19 13:13:42 deimos timed[425]: date changed by server.baldwin.cx from Mon
> Nov 19 13:14:05 2001 
> 
> And work fine.  Also, FWIW, timed spits out a bunch of unaligned access
> warnings when it starts up on alpha.

-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011120003613.GA29465>