pstack missing from Ubuntu 10.10

Hi All
I would like to use the tool "pstack" to get a sample of the stack trace for a process.
As far as I understood It seems widely available in all Linux systems, but it is not in Ubuntu 10.10.
I tried using apt-get as per some posts in few forum, but it cannot be found in the APT repositories.

I found this link here https://launchpad.net/ubuntu/\+source/pstack/1.2-1 but I see 3 files:
A => 1 .dsc file that I don't know what does it mean
B => 2 different source tarball ( 1 ORIGINAL + 1 DIFF ?!?! ). I guess that they must be installed one after one in strictly order.

Is there any safe way to install it into my Ubuntu?
Any package that contains it that can be found via APT-GET?
Thanks a lot
Regards

According to the Launchpad site it should be available in Maverick (10.10) in the universe section. Could you post your /etc/apt/sources.list?

As for the files you've found: the .dsc is a general description of the package, the first tarball is the original source, and the second are the changes made by the packager to better fit into the distribution. You'll have to run dpkg-buildpackage on it to create an installable .deb.

Thanks for your kind help: here we go my list.

#deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release amd64 (20101007)]/ maverick main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://gb.archive.ubuntu.com/ubuntu/ maverick main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ maverick-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ maverick universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick universe
deb http://gb.archive.ubuntu.com/ubuntu/ maverick-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://gb.archive.ubuntu.com/ubuntu/ maverick multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ maverick-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://gb.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu maverick partner
# deb-src http://archive.canonical.com/ubuntu maverick partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://extras.ubuntu.com/ubuntu maverick main

deb http://security.ubuntu.com/ubuntu maverick-security main restricted
deb-src http://security.ubuntu.com/ubuntu maverick-security main restricted
deb http://security.ubuntu.com/ubuntu maverick-security universe
deb-src http://security.ubuntu.com/ubuntu maverick-security universe
deb http://security.ubuntu.com/ubuntu maverick-security multiverse
deb-src http://security.ubuntu.com/ubuntu maverick-security multiverse

Hm, you have the universe repo enabled. Did you run apt-get update after changing your repository list?

Auchh...no.
I did it after your advice but still calling

sudo apt-get install pstack

I don't get anything back.
I am trying to build the files shown in the web site.
I downloaded the files and called

me@myPc:~/myFolder$dpkg-source -x pstack_1.2-1.dsc

gpgv: Signature made Fri 08 Oct 2004 19:00:15 BST using DSA key ID AB474598
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./pstack_1.2-1.dsc
dpkg-source: info: extracting pstack in pstack-1.2
dpkg-source: info: unpacking pstack_1.2.orig.tar.gz
dpkg-source: info: applying pstack_1.2-1.diff.gz
dpkg-source: info: upstream files that have been modified: 
 pstack-1.2/pstack.c

After then I try to build the library

cd pstack
make

cc -Wall -DVERSION=\"1.2\"  -g -o pstack pstack.c
pstack.c: In function �loadSymbols':
pstack.c:505: warning: cast from pointer to integer of different size
pstack.c: In function �crawl':
pstack.c:544: error: �EIP' undeclared (first use in this function)
pstack.c:544: error: (Each undeclared identifier is reported only once
pstack.c:544: error: for each function it appears in.)
pstack.c:546: error: �EBP' undeclared (first use in this function)
make: *** [pstack] Error 1

From the README files I see that they need ELF library. I installed them already but still it cannot compile. I might probably using a wrong one or what?

Ugh, sorry for not noticing this earlier, but which platform are you running on? Because there's a bug report for pstack on AMD64 platforms.

To properly (attempt) to build a package, run this

sudo apt-get install fakeroot build-essential dpkg-dev    # Install required programs to build
sudo apt-get source pstack    # Get the source
sudo apt-get build-dep pstack    # Get possible required extra programs for the build
dpkg-source -x pstack*.dsc    # Unpack/patch the source
cd pstack-<version>
dpkg-buildpackage -rfakeroot -b    # Build a .deb
dpkg -i ../pstack*.deb    # Install the package if all went well

I have INTEL based on this call

cat /etc/proc/info

model name    : Intel(R) Core(TM)2 Duo CPU     E8500  @ 3.16GHz

but executing the list of commands you are suggesting I see a suspect file called

pstack_1.2-1_amd64.changes

and other errors so the procedure is not successfull ( I am going to retry again ).

If you see code below is noted where is produced.
---------- Post updated at 07:08 AM ---------- Previous update was at 07:05 AM ----------

ME@MyPC:~/Downloads$ sudo apt-get source pstack

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Need to get 16.5kB of source archives.
Get:1 http://gb.archive.ubuntu.com/ubuntu/ maverick/universe pstack 1.2-1 (dsc) [555B]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ maverick/universe pstack 1.2-1 (tar) [14.2kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ maverick/universe pstack 1.2-1 (diff) [1,706B]
Fetched 16.5kB in 0s (265kB/s)
gpgv: Signature made Fri 08 Oct 2004 19:00:15 BST using DSA key ID AB474598
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./pstack_1.2-1.dsc
dpkg-source: info: extracting pstack in pstack-1.2
dpkg-source: info: unpacking pstack_1.2.orig.tar.gz
dpkg-source: info: applying pstack_1.2-1.diff.gz
dpkg-source: info: upstream files that have been modified: 
 pstack-1.2/pstack.c

another error is this where the host architecture is recognized as AMD64.

ME@MYPC~/Downloads/pstack-1.2$ dpkg-buildpackage -rfakeroot -b

dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions
dpkg-buildpackage: source package pstack
dpkg-buildpackage: source version 1.2-1
dpkg-buildpackage: source changed by Baruch Even <baruch@debian.org>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build pstack-1.2
 fakeroot debian/rules clean
test -x debian/rules
dh_testroot
rm -f debian/stamp-makefile-build debian/stamp-makefile-install
/usr/bin/make  -C . CFLAGS="-g -O2 -g -Wall -O2" CXXFLAGS="-g -O2 -g -Wall -O2" CPPFLAGS="" LDFLAGS="-Wl,-Bsymbolic-functions"  -k clean
make[1]: Entering directory `/home/emanueler/Downloads/pstack-1.2'
rm pstack
rm: cannot remove `pstack': No such file or directory
make[1]: *** [clean] Error 1
make[1]: Leaving directory `/home/emanueler/Downloads/pstack-1.2'
make: [makefile-clean] Error 2 (ignored)
dh_clean 
dh_clean: Compatibility levels before 5 are deprecated.
 debian/rules build
make: Nothing to be done for `build'.
 fakeroot debian/rules binary
make: Nothing to be done for `binary'.
 dpkg-genchanges -b >../pstack_1.2-1_amd64.changes
dpkg-genchanges: error: cannot read files list file: No such file or directory
dpkg-buildpackage: error: dpkg-genchanges gave error exit status 2

What's the output of uname -a ? Because I think this is only a perceived "error": the 64bit architecture used in current personal computers was developed by AMD, not Intel, and is called AMD64 for that reason. Intels own 64bit architecture, Itanium, never really caught on outside of high-end servers (the ones where you pay more for the OS than for a mid-range server hardware).

uname -a

Linux MyPC 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 x86_64 GNU/Linux

I am afraid that pstack is not available for 64 bits. isn' it?

Doesn't seem so at present. I doubt it'll stay buggy forever, though!