From owner-freebsd-alpha Sun Dec 23 0: 0:27 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id 71BD937B405 for ; Sun, 23 Dec 2001 00:00:12 -0800 (PST) Received: (from uucp@localhost) by srv1.cosmo-project.de (8.11.6/8.11.6) with UUCP id fBN807m34430; Sun, 23 Dec 2001 09:00:07 +0100 (CET) (envelope-from ticso@cicely9.cicely.de) Received: from mail.cicely.de (cicely20.cicely.de [10.1.1.22]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id fBN80ntx005732; Sun, 23 Dec 2001 09:00:50 +0100 (CET)?g (envelope-from ticso@cicely9.cicely.de) Received: from cicely9.cicely.de (cicely9.cicely.de [10.1.7.11]) by mail.cicely.de (8.11.0/8.11.0) with ESMTP id fBN80nW25687; Sun, 23 Dec 2001 09:00:49 +0100 (CET) Received: (from ticso@localhost) by cicely9.cicely.de (8.11.6/8.11.6) id fBN80lq62379; Sun, 23 Dec 2001 09:00:47 +0100 (CET) (envelope-from ticso) Date: Sun, 23 Dec 2001 09:00:46 +0100 From: Bernd Walter To: Matthew Jacob Cc: Wilko Bulte , freebsd-alpha@FreeBSD.ORG Subject: Re: FreeBSD 4.5 alpha buyglet Message-ID: <20011223080046.GB61241@cicely9.cicely.de> References: <20011223032201.GA61241@cicely9.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.24i X-Operating-System: FreeBSD cicely9.cicely.de 5.0-CURRENT alpha Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, Dec 22, 2001 at 10:37:55PM -0800, Matthew Jacob wrote: > > > On Sun, 23 Dec 2001, Bernd Walter wrote: > > > On Sat, Dec 22, 2001 at 05:12:32PM -0800, Matthew Jacob wrote: > > > > > > >Yes, see Message-ID: <20011221175252.A25617@freebie.xs4all.nl> > > > >on -alpha. > > > > > > Ooops- so right you are. Anyway, I looked at this just a bit- seems a compiler > > > error to me- it shouldn't be generating ldq's for those tags because they > > > couldn't possibly be at 8 byte offsets given the structures involved. Oh well. > > > > The two variables it fails on are defined as beeing long but only 32 bit > > aligned. I'm more about beleaving the sysctl tranfer misaligns them. But I > > have currently no system where I see this problem so I can't be shure. The > > sysctl receive buffer is malloc'ed so it should be 64 bit aligned. > > Hmm? I used gdb to find the misaligned reference to be, e.g.: > > ***> if (ifm->ifm_data.ifi_metric) > printf(" metric %ld", ifm->ifm_data.ifi_metric); > ***> if (ifm->ifm_data.ifi_mtu) > printf(" mtu %ld", ifm->ifm_data.ifi_mtu); > putchar('\n'); > > struct if_msghdr { > u_short ifm_msglen; /* to skip over non-understood messages */ > u_char ifm_version; /* future binary compatability */ > u_char ifm_type; /* message type */ > int ifm_addrs; /* like rtm_addrs */ > int ifm_flags; /* value of if_flags */ > u_short ifm_index; /* index for associated ifp */ > offset: 14 > struct if_data ifm_data;/* statistics and other data about if */ > }; > > > ... > > > struct if_data { > /* generic interface information */ > u_char ifi_type; /* ethernet, tokenring, etc */ > u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc > */ > u_char ifi_addrlen; /* media address length */ > u_char ifi_hdrlen; /* media header length */ > u_char ifi_recvquota; /* polling quota for receive intrs */ > u_char ifi_xmitquota; /* polling quota for xmit intrs */ > > offset: 6 > > u_long ifi_mtu; /* maximum transmission unit */ ^^^^^^^^^^^^^^^^ > u_long ifi_metric; /* routing metric (external only) */ ^^^^^^^^^^^^^^^^^^^ > u_long ifi_baudrate; /* linespeed */ > > > So, if gdb was right and dereferencing ifi_mtu or ifi_metric is generating > a ldq, then the compiler seems to be broken. What else would you use for loading a 64 bit value? If it starts with the second or later interface I would asume it's because several structs are concatenated in the sysctl output and read as one. If one of them is not n*8 bytes long you get an alignment offset. But as I don't have more debug output than posted on the list I can only guess. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message