From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 16 13:20:36 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E8E106566B for ; Tue, 16 Jun 2009 13:20:36 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by mx1.freebsd.org (Postfix) with ESMTP id E0FC48FC13 for ; Tue, 16 Jun 2009 13:20:35 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by bwz27 with SMTP id 27so317359bwz.43 for ; Tue, 16 Jun 2009 06:20:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.220.18 with SMTP id x18mr4440962muq.24.1245158432272; Tue, 16 Jun 2009 06:20:32 -0700 (PDT) In-Reply-To: <200906151353.06630.mel.flynn+fbsd.hackers@mailing.thruhere.net> References: <200906151353.06630.mel.flynn+fbsd.hackers@mailing.thruhere.net> Date: Tue, 16 Jun 2009 15:20:32 +0200 Message-ID: From: =?ISO-8859-1?Q?Marius_N=FCnnerich?= To: Mel Flynn Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: How best to debug locking/scheduler problems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2009 13:20:36 -0000 On Mon, Jun 15, 2009 at 23:53, Mel Flynn 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