You are not logged in.

#1 2009-12-03 02:32:41

darenw
Member
From: Trego Montana
Registered: 2008-07-04
Posts: 106
Website

pstack?

Is pstack in some official or unofficial Arch package?  Pstack can print the call stack of a running app, great for debugging.   Search on this site doen't smell the faintest whiff of it here.  I can only find 32-bit versions of questionable quality out there in the wild.   I'm running x86_64, and must use pstack on a 64 bit program.


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#2 2009-12-03 09:40:18

mhe
Member
Registered: 2009-12-03
Posts: 1

Re: pstack?

I don't know if someone has ported Solaris' ptrace, but for printing a snapshot of the call stack of a running process, using gdb in batch mode (gdb -batch -ex bt -p insert_pid_here) should do.

Offline

#3 2009-12-03 11:36:01

sr
Member
Registered: 2009-10-12
Posts: 51

Re: pstack?

I believe darenw's talking about this program: http://sourceforge.net/projects/bsd-pstack/

Offline

#4 2009-12-03 15:49:46

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: pstack?

There is no package for it in the repos or aur, something that you would know if you had searched.

Feel free to write a PKGBUILD and submit it tho smile


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#5 2009-12-04 20:21:04

darenw
Member
From: Trego Montana
Registered: 2008-07-04
Posts: 106
Website

Re: pstack?

Yes, that BSD thing is the one.   If I were more of a BSD user, I would have mentioned it. 

I found lsstack, which only runs 32-bit but might be hackable into 64 bit shape.  It is not compiling properly today.

But neither one may be necessary - I have found that gdb can attach to a running process and do a backtrace, without killing the process.  I just have to figure out more about bt'ing each thread.   Gdb does have to pause execution of the program, which I suspect pstack wouldn't need to do.


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#6 2009-12-04 20:39:05

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: pstack?

FWIW, bsd-pstack apparently isn't portable to Linux. It's expecting quite different structs from those we have.

Offline

#7 2009-12-05 02:28:32

darenw
Member
From: Trego Montana
Registered: 2008-07-04
Posts: 106
Website

Re: pstack?

FWIW (and probably worth less than ataraxia's FWIW) the lsstack source does compile after some hacking, and sort of gives some slightly useful information.  It is not reliable and in need of more hacking.  This is what weekends are for.

I suspect the bsd pstack would be better, if its structs and stuff could be modified.

Last edited by darenw (2009-12-05 02:32:59)


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#8 2010-01-28 11:01:22

dothebart
Member
Registered: 2010-01-28
Posts: 1

Re: pstack?

I'm also on the search for this, Found pstack by redhat, but it doesn't seem to work at all.
lsstack seems to just print one thread

ataraxia: you're searching for
thread apply all bt (full)

--
Citadel.org - Groupware for the rest of us

Offline

#9 2010-01-28 16:12:43

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: pstack?

You can use glibc's built-in backtrace: http://www.gnu.org/s/libc/manual/html_n … races.html

An example from an error handler I wrote: http://gitorious.org/dimension/dimensio … .c#line139

Offline

Board footer

Powered by FluxBB