From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 2 17:13:12 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50FC210657B0; Mon, 2 Apr 2012 17:13:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1BBD18FC08; Mon, 2 Apr 2012 17:13:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6839EB95E; Mon, 2 Apr 2012 13:13:11 -0400 (EDT) From: John Baldwin To: Yuri Date: Mon, 2 Apr 2012 13:12:36 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <4F775DF5.1020704@rawbw.com> <201204020831.09253.jhb@freebsd.org> <4F79D63E.7010200@rawbw.com> In-Reply-To: <4F79D63E.7010200@rawbw.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201204021312.36568.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 02 Apr 2012 13:13:11 -0400 (EDT) Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: Is there any modern alternative to pstack? 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: Mon, 02 Apr 2012 17:13:12 -0000 On Monday, April 02, 2012 12:39:26 pm Yuri wrote: > On 04/02/2012 05:31, John Baldwin wrote: > > Hmm, I don't know if the port has it, but I did some work on pstack a while > > ago to make it work with libthread_db so it at least handles i386 ok. It > > needs to be modified to use something like libunwind though or some other > > unwinder. And possibly it should use libelf instead of its own ELF-parsing > > code. > > I see pstack -1.2_1 failing even on i386: > > pstack: cannot read context for thread 0x1879f > pstack: failed to read more threads Yes, threads don't work for modern binaries (newer than 4.x) without my changes to make it use libthread_db. You can find the patch I used for this at http://www.freebsd.org/~jhb/patches/pstack_threads.patch -- John Baldwin