Date: Fri, 21 Dec 2001 17:52:52 +0100 From: Wilko Bulte <wkb@freebie.xs4all.nl> To: freebsd-alpha@freebsd.org Subject: FW: Re: bah: new bug, unaligned accesses in ifconfig on -stable Message-ID: <20011221175252.A25617@freebie.xs4all.nl>
next in thread | raw e-mail | index | archive | help
Hi, I just verified it on my DS10 with 4.5-PRERELEASE and the problem is exactly what Rich describes below: ds10#gdb ./ifconfig ifconfig.core GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alpha-unknown-freebsd"... Core was generated by `ifconfig'. Program terminated with signal 10, Bus error. Reading symbols from /usr/lib/libipx.so.2...done. Reading symbols from /usr/lib/libc.so.4...done. Reading symbols from /usr/libexec/ld-elf.so.1...done. #0 0x1200039dc in status (afp=0x120009da8, addrcount=0, sdl=0x74656e62772e30, ifm=0x12002011c, ifam=0x0) at ifconfig.c:1152 1152 if (ifm->ifm_data.ifi_metric) (gdb) I don't quite understand why it happens this way Wilko ----- Forwarded message from Rich Bud <rbud@fortean.com> ----- Date: Mon, 17 Dec 2001 21:40:50 -0500 (EST) From: Rich Bud <rbud@fortean.com> Subject: Re: bah: new bug, unaligned accesses in ifconfig on -stable To: Wilko Bulte <wkb@freebie.xs4all.nl> > Using a freshly built -stable buildworld ifconfig gives > me unaligned accesses. Confirmed on DS10 and DS20. > This is a recently introduced bug, last week (IIRC) it was > not there yet This was in place as of 7 Dec (revision v1.51.2.14 of ifconfig.c). On my 500a only faith0 gave the error; someone else wrote in to say it was happening to both their NICs. I tracked it down to line 1120 (line 1152 in the new v1.51.2.15) in the status() function, where it was complaining about the following 2 if statements: if (ifm->ifm_data.ifi_metric) printf(" metric %d", ifm->ifm_data.ifi_metric); if (ifm->ifm_data.ifi_mtu) printf(" mtu %ld", ifm->ifm_data.ifi_mtu); I looked at v1.51.2.13 and put back what they did, which was create local int variables for mtu and metric (they're u_long in the structure), and tried: int metric, mtu; ... metric = ifm->ifm_data.ifi_metric; if (metric) printf(" metric %d", metric); mtu = ifm->ifm_data.ifi_mtu; if (mtu) printf(" mtu %d", mtu); That, amazingly, fixed it. I then tried making mtu and metric u_long, and the errors on the if statements returned. Very odd. I also saw no reason why it should happen to different interfaces for different people. I meant to come back to this, but got sidetracked and forgot about it until i saw your post. Hope this helps a little, Rich Bud <rbud@fortean.com> ----- End forwarded message ----- -- | / o / /_ _ email: wilko@FreeBSD.org |/|/ / / /( (_) Bulte Arnhem, The Netherlands 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?20011221175252.A25617>