Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2009 13:53:05 -0800
From:      Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net>
To:        freebsd-hackers@freebsd.org
Subject:   How best to debug locking/scheduler problems
Message-ID:  <200906151353.06630.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net>

next in thread | raw e-mail | index | archive | help
Hi,

I'm trying to get to the bottom of a bug with getpeername() and certain kde=
4=20
applications which is probably as low-level as the libthr and the scheduler.

=46rom browsing various related files in sys/kern it seems KTR is a good be=
t to=20
get the information needed, yet it isn't really well supported in userland.=
=20
=46or one, I've got no clue other then logging console output(?) how to ret=
rieve=20
the lock info or filter it in userland from reading ktr(9) and alq(9). Gdb =
is=20
useless as the process doesn't give the information gdb wants and gdb just=
=20
hangs in wait. ktrace also does not provide anything as there are no more=20
syscalls being made, so I'll have to get to the bottom of this by tracing a=
nd=20
filtering.

Short description of the problem:
a process never gets out of mi_switch and remains locked even init tries to=
=20
shut it down.

% procstat -t 4283

  PID    TID COMM             TDNAME           CPU  PRI STATE   WCHAN   =20
 4283 100215 kdeinit4         -                  0  128 lock    *unp_mtx =20
% procstat -k 4283

  PID    TID COMM             TDNAME           KSTACK                      =
=20
 4283 100215 kdeinit4         -                mi_switch turnstile_wait=20
_mtx_lock_sleep uipc_peeraddr kern_getpeername getpeername syscall=20
Xint0x80_syscall=20
% ps -ww 4283
  PID  TT  STAT      TIME COMMAND
 4283  ??  T      0:00.38 kdeinit4: kdeinit4: kio_http http=20
local:/tmp/ksocket-mel/klauncherxJ1635.slave-socket local:/tmp/ksocket-
mel/plasmayC1653.slave-socket (kdeinit4)

%=08ls -l /tmp/ksocket-mel/

total 2
=2Drw-rw-r--  1 mel  wheel  62 Jun 14 22:55 KSMserver__0
srw-------  1 mel  wheel   0 Jun 14 22:55 kdeinit4__0
srwxrwxr-x  1 mel  wheel   0 Jun 14 22:55 klauncherxJ1635.slave-socket

=2D-=20
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906151353.06630.mel.flynn%2Bfbsd.hackers>