Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2010 09:45:59 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        batcilla@gmail.com
Cc:        freebsd-arm@FreeBSD.org
Subject:   Re: kdump on ARM
Message-ID:  <20100217.094559.29593248078653355.imp@bsdimp.com>
In-Reply-To: <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com>
References:  <4B7BFAA4.4040607@semihalf.com> <201002171542.35757.hselasky@c2i.net> <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.co=
m>
            batcilla itself <batcilla@gmail.com> writes:
: 2010/2/17 Hans Petter Selasky <hselasky@c2i.net>
: >
: > On Wednesday 17 February 2010 15:18:12 Grzegorz Bernacki wrote:
: > > Hi,
: > >
: > > I've noticed that kdump on ARM doesn't work properly, it generate=
s bus
: > > =A0error. The problem is that structures dumped into ktrace.out a=
re not
: > > =A0aligned. Processing such a structure causes Aligment Fault. On=
e solution
: > > =A0is to copy structure into local variable and then process it, =
please see
: > > =A0patch below. But I am not sure if this is the best solution an=
d maybe
: > > =A0someone has a better idea.
: > >
: > > grzesiek
: > >
: > >
: > > diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
: > > index 386221e..5a15886 100644
: > > --- a/usr.bin/kdump/kdump.c
: > > +++ b/usr.bin/kdump/kdump.c
: > > @@ -1325,6 +1325,10 @@ ktrstat(struct stat *statp)
: > > =A0 void
: > > =A0 ktrstruct(char *buf, size_t buflen)
: > > =A0 {
: > > +#if defined(__arm__)
: > > + =A0 =A0 =A0 struct stat stat;
: > > + =A0 =A0 =A0 struct sockaddr sockaddr;
: > > +#endif
: > > =A0 =A0 =A0 =A0 =A0char *name, *data;
: > > =A0 =A0 =A0 =A0 =A0size_t namelen, datalen;
: > > =A0 =A0 =A0 =A0 =A0int i;
: > > @@ -1348,12 +1352,22 @@ ktrstruct(char *buf, size_t buflen)
: > > =A0 =A0 =A0 =A0 =A0if (strcmp(name, "stat") =3D=3D 0) {
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (datalen !=3D sizeof(struct=
 stat))
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto invalid;
: > > +#if defined(__arm__)
: > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(&stat, data, sizeof(struct s=
tat));
: > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ktrstat(&stat);
: > > +#else
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ktrstat((struct stat *)data);
: > > +#endif
: > > =A0 =A0 =A0 =A0 =A0} else if (strcmp(name, "sockaddr") =3D=3D 0) =
{
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (datalen < sizeof(struct so=
ckaddr) ||
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0datalen !=3D ((struct =
sockaddr *)(data))->sa_len)
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto invalid;
: > > +#if defined(__arm__)
: > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(&sockaddr, data, sizeof(stru=
ct sockaddr));
: > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ktrsockaddr(&sockaddr);
: > > +#else
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ktrsockaddr((struct sockaddr *=
)data);
: > > +#endif
: > > =A0 =A0 =A0 =A0 =A0} else {
: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("unknown structure\n");=

: > > =A0 =A0 =A0 =A0 =A0}
: >
: > I think more than ARM is affected by this.
: >
: > --HPS
: ARM affected definitely, just today had that Align error with -curren=
t
: while tried to use ng_bridge with wlan0

Where exactly was the error?  Do you have a traceback?

Warner



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