Bug#950168: pstack always fails with "crawl: Input/output error"

2020-02-01 Thread Tim Rühsen
On 01.02.20 13:44, Andreas Beckmann wrote:
> On Wed, 29 Jan 2020 19:51:22 +0100 =?utf-8?q?Tim_R=C3=BChsen?=
> The manpage (dated Feb 25 2002) says:
> 
> RESTRICTIONS
>pstack currently works only on Linux, only on an x86  machine
>running  32  bit  ELF binaries (64 bit not supported).  Also,
>for symbolic information, you need to use a GNU  compiler  to
>generate  your  program, and you can't strip symbols from the
>binaries.  For thread information to be dumped, you  have  to
>use the debug-aware version of the LinuxThreads libpthread.so
>library.  (To check, run nm(1) on your pthreads library,  and
>make   sure  that  the  symbol  "__pthread_threads_debug"  is
>defined.)  Threads are not  supported  with  the  newer  NPTL
>libpthread.so library.
> 
> So the pstack tool is probably useless on modern systems.

I believe the man page and the top comment within pstack.c are is wrong.
The source code explicitly supports 64bit ELF, you can build it for
amd64, it does some work, but fails on 'crawl...'.

The man page of ptrace() gives no obvious hint why it may fail on amd64
and not on x86 here.

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Bug#950168: pstack always fails with "crawl: Input/output error"

2020-02-01 Thread Andreas Beckmann
On Wed, 29 Jan 2020 19:51:22 +0100 =?utf-8?q?Tim_R=C3=BChsen?=
 wrote:
> Web searches so far didn't help.
> 
> Any ideas / hints ?

The manpage (dated Feb 25 2002) says:

RESTRICTIONS
   pstack currently works only on Linux, only on an x86  machine
   running  32  bit  ELF binaries (64 bit not supported).  Also,
   for symbolic information, you need to use a GNU  compiler  to
   generate  your  program, and you can't strip symbols from the
   binaries.  For thread information to be dumped, you  have  to
   use the debug-aware version of the LinuxThreads libpthread.so
   library.  (To check, run nm(1) on your pthreads library,  and
   make   sure  that  the  symbol  "__pthread_threads_debug"  is
   defined.)  Threads are not  supported  with  the  newer  NPTL
   libpthread.so library.

So the pstack tool is probably useless on modern systems.


Andreas



Bug#950168: pstack always fails with "crawl: Input/output error"

2020-01-29 Thread Tim Rühsen
Package: pstack
Version: 1.3.1-1+b1
Severity: grave
Justification: renders package unusable

Dear Maintainer,

I can't get pstack working as expected. Even not as root.

Example:
# pstack 2280

2280: /usr/lib/upower/upowerd
(No symbols found)
0x7fbfe723dd0f:  (55babe9e5900, 51, 0, 0, 0, 7fbfe7593f30) + 
aa46415ffdb3
crawl: Input/output error
Error tracing through process 2280
0x10008: 


I assume there something going on with ptrace(), as I see the same issue
with a ptrace example code that uses PTRACE_PEEKDATA.
PTRACE_ATTACH seems to work, but PTRACE_PEEKDATA returns error (errno is 5).

strace and gdb work well.

Web searches so far didn't help.

Any ideas / hints ?

Regards, Tim

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.4.0-3-amd64 (SMP w/12 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE= 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages pstack depends on:
ii  libc6  2.29-9

pstack recommends no packages.

pstack suggests no packages.

-- no debconf information