Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Dec 2016 14:52:42 -0500
From:      Lee D <embaudarm@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Please help me understand "Translation Fault" in custom device drivers, and how to debug
Message-ID:  <CANC_bnPoaZF6x2G9O8ex7rW5iHv2zELmhJuj%2BLpJfEPbjWNLLA@mail.gmail.com>
In-Reply-To: <85666618-B6A5-4577-86B9-914DEDE84ACD@bluezbox.com>
References:  <CANC_bnPtD%2Bay9OQmZHjgzbcEq75mFNss6O7QCUY6Yg0tnVZ-Fw@mail.gmail.com> <85666618-B6A5-4577-86B9-914DEDE84ACD@bluezbox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 4, 2016 at 2:13 PM, Oleksandr Tymoshenko <gonzo@bluezbox.com>
wrote:

>
> > On Dec 4, 2016, at 10:32 AM, Lee D <embaudarm@gmail.com> wrote:
> >
> > Hello,
> >
> > I need help understanding what a translation fault is, and how to debug
> > it.  I have googled like crazy but can't seem to find any detailed
> > information.
> >
> > I am working on an embedded system using an ARM processor, and
> consequently
> > am writing a bunch of device device drivers for my custom hardware.
> >
> > I am having a problem with occasional crashes when kldload'ing my modul=
es
> > in a boot script.  I get various errors, including "Translation Fault"
> (L1
> > or L2), "Alignment Fault", "vm_fault", and "undefined instruction in
> > kernel".  My code works 95% of the time though.
> >
> > I never see any crashes while running, so I don't think this is a flaky
> > hardware problem.
> >
> > Any suggestions on what kernel debugger commands to enter to gather
> > information would also be helpful.  Here are the commands I am currentl=
y
> > recording the output of when I get a crash:
> >
> > db> bt
> > db> ps
> > db> show intr
> > db> show proc 618
> > db> show allpcpu
> > db> show allrman
> > db> show intrcnt
> > db> show proc
> > db> show procvm
> >
> > For a single concrete example, here is a backtrace of a device driver
> that
> > failed with a translation fault on kldload.  This BT is unique in that =
it
> > actually seems to contain useful information.  Most of the backtraces
> just
> > show some abort/exeception related calls and then say "Unable to unwind
> > into user space" (paraphrased), leaving me no info about where my crash
> > happened.
> >
> > FreeBSD 10.3
>
> Hi Lee,
>
> Random crashes during kldload sounds like missing or incomplete icache
> sync to me. You can take a look at icache-realted fixes in HEAD=E2=80=99s=
 sys/arm
> and try to backport them to 10.3.


Oleksandr,

Thanks, I will take a look.  Maybe moving to 11.0 is the best thing to do.

But I'm only seeing crashes in a couple my modules, not all of them and not
anything I didn't write.  And (seemingly) only when they are started from a
script in /etc/rc,d/ at boot time.

Clearly I've messed something up.

Lee



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANC_bnPoaZF6x2G9O8ex7rW5iHv2zELmhJuj%2BLpJfEPbjWNLLA>