From owner-freebsd-hackers Mon Nov 19 16:36:23 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mailc.telia.com (mailc.telia.com [194.22.190.4]) by hub.freebsd.org (Postfix) with ESMTP id 74EEF37B417 for ; Mon, 19 Nov 2001 16:36:18 -0800 (PST) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailc.telia.com (8.11.6/8.11.6) with ESMTP id fAK0aHs04434 for ; Tue, 20 Nov 2001 01:36:17 +0100 (CET) Received: from ertr1013.student.uu.se (h185n2fls20o913.telia.com [212.181.163.185]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id BAA10947 for ; Tue, 20 Nov 2001 01:36:16 +0100 (CET) Received: (qmail 33399 invoked by uid 1001); 20 Nov 2001 00:36:14 -0000 Date: Tue, 20 Nov 2001 01:36:14 +0100 From: Erik Trulsson To: John Baldwin Cc: hackers@FreeBSD.org Subject: Re: Ok, who broke timed? Message-ID: <20011120003613.GA29465@student.uu.se> Mail-Followup-To: John Baldwin , hackers@FreeBSD.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23.2i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 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 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. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message