How best to debug locking/scheduler problems

Marius Nünnerich marius at nuenneri.ch
Tue Jun 16 13:20:36 UTC 2009


On Mon, Jun 15, 2009 at 23:53, Mel
Flynn<mel.flynn+fbsd.hackers at mailing.thruhere.net> wrote:
> Hi,
>
> I'm trying to get to the bottom of a bug with getpeername() and certain kde4
> applications which is probably as low-level as the libthr and the scheduler.
>
> From browsing various related files in sys/kern it seems KTR is a good bet to
> get the information needed, yet it isn't really well supported in userland.
> For one, I've got no clue other then logging console output(?) how to retrieve
> the lock info or filter it in userland from reading ktr(9) and alq(9). Gdb is
> useless as the process doesn't give the information gdb wants and gdb just
> hangs in wait. ktrace also does not provide anything as there are no more
> syscalls being made, so I'll have to get to the bottom of this by tracing and
> filtering.
>
> Short description of the problem:
> a process never gets out of mi_switch and remains locked even init tries to
> shut it down.
>

[snip]

Hi Mel,

my idea would be to try DTrace for this. Hopefully the following link
will help you:
http://wiki.freebsd.org/DTrace
There are more links at the bottom.

I added DTrace probes to geom a while ago and it's really easy. Feel
free to ask for more help.

Kind regards
Marius


More information about the freebsd-hackers mailing list