Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2001 22:37:55 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        Bernd Walter <ticso@cicely9.cicely.de>
Cc:        Wilko Bulte <wkb@freebie.xs4all.nl>, freebsd-alpha@FreeBSD.ORG
Subject:   Re: FreeBSD 4.5 alpha buyglet
Message-ID:  <Pine.BSF.4.21.0112222233290.2338-100000@beppo>
In-Reply-To: <20011223032201.GA61241@cicely9.cicely.de>

next in thread | previous in thread | raw e-mail | index | archive | help


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.

-matt





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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0112222233290.2338-100000>