Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jun 2012 17:45:50 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        toolchain@freebsd.org
Subject:   Re: libunwind-based pstack(1)
Message-ID:  <20120605144550.GM85127@deviant.kiev.zoral.com.ua>
In-Reply-To: <20120605143417.GJ47353@felucia.tataz.chchile.org>
References:  <20120524122518.GJ2358@deviant.kiev.zoral.com.ua> <20120605143417.GJ47353@felucia.tataz.chchile.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, Jun 05, 2012 at 04:34:17PM +0200, Jeremie Le Hen wrote:
> Hi Kostik,
> 
> On Thu, May 24, 2012 at 03:25:18PM +0300, Konstantin Belousov wrote:
> > Hi,
> > I reimplemented pstack(1) using libunwind. The source is available at
> > the git repository at http://people.freebsd.org/~kib/git/pstacku.git/ .
> > To use it, you should also use git HEAD of the libunwind from
> > http://libunwind.nongnu.org, I do not think that version from ports
> > will work. Due to libunwind use, this pstack works on i386 and amd64.
> > When libunwind/FreeBSD is ported to other arches, adding corresponding
> > support to pstack is quite easy.
> > 
> > So far, I tried to implement most of the features supported by original
> > pstack, but there are limitations due to use of libunwind. Only libthr
> > supported as the threading library, you probably get some funny results
> > for libc_r and kse-based libpthread.
> > 
> > The big unimplemented feature is coredump stack dumping, but libunwind
> > only got support for Linux coredump backtracing a day ago, and I did not
> > yet looked at porting this to FreeBSD.
> > 
> > Lesser implemented but not properly working feature is the arguments 
> > printing. I might fix this later.
> 
> I tried it on RELENG_9/amd64 it works mostly, but most of the time I only get
> the stack address and an offset from the _init symbol when the address
> points into the binary text or "????????" when it is a shared library.
> Supposedly this is because there is no known symbol for the function,
> but having used Solaris' pstack quite extensively, I was a little bit
> disappointed.
> 
> % obiwan:/opt/bin# ./pstack -O 2237
> % 2237: /usr/local/libexec/postfix/nqmgr (osrel 0)
> % Thread 101037:
> %  0x80455153c ???????? in /lib/libcrypto.so.6
> %  0x42118a event_loop+0x11a in /usr/local/libexec/postfix/nqmgr
> %  0x40b217 trigger_server_main+0xbd7 in /usr/local/libexec/postfix/nqmgr
> %  0x403089 main+0xd9 in /usr/local/libexec/postfix/nqmgr
> %  0x402f1c _start+0x9c in /usr/local/libexec/postfix/nqmgr
> %  0x800d85000 ???????? in /usr/local/lib/libpcre.so.1
Can you show me the kdump of the run when '???????' is reported for dso
ip's ?

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (FreeBSD)

iEYEARECAAYFAk/OG50ACgkQC3+MBN1Mb4iCsQCgkOMWKhSm1M4mvGb4nHDwM1jd
ihIAoKfnPVZQ0n30fkYFppLr/+Bu61pH
=0pdc
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120605144550.GM85127>