Package: strace
Version: 4.5.20-2.3
Severity: normal

Suppose I run a buggy program under strace.

[vampire /tmp/mdw/strace-bug]strace -ospew sh -c 'kill -SEGV $$'
Segmentation fault (core dumped)

That's nice.  Now I can debug my program using the core dump to tell me
what state it was in, and use the strace spew to help me understand how
it got there.  Wait a minute...

[vampire /tmp/mdw/strace-bug]file core
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style,
from 'strace -o/dev/null sh -c kill -SEGV $$'
[vampire /tmp/mdw/strace-bug]gdb /usr/bin/strace core
...
Program terminated with signal 11, Segmentation fault.
#0  0xb774b424 in __kernel_vsyscall ()
(gdb) bt
#0  0xb774b424 in __kernel_vsyscall ()
#1  0xb7601911 in raise () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#2  0x0804b883 in ?? ()
#3  0xb75ede46 in __libc_start_main () from
#/lib/i386-linux-gnu/i686/cmov/libc.so.6
#4  0x08049831 in ?? ()
Backtrace stopped: Not enough registers or memory available to unwind
further
(gdb) quit

That's not my core file.  That's a completely useless core file of
strace committing suicide.  Where's my core file gone?

The fine manual says:

DIAGNOSTICS
       When  command exits, strace exits with the same exit status.  If
       command is terminated by a signal, strace terminates itself with
       the same signal, so that strace can be used as a wrapper process
       transparent to the invoking parent process.

I don't think clobbering the core file with a useless core file is
particularly transparent.  Unfortunately, the obvious hacks (setting the
soft RLIMIT_CORE to zero; changing to a non-writable directory) don't
work because they clear the WCOREDUMP exit-status bit.  Maybe strace
should make a new temporary directory, change to it, fork a child
process, kill itself, and have the child clean up the core file and the
temporary directory.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages strace depends on:
ii  libc6  2.13-21

strace recommends no packages.

strace suggests no packages.

-- no debconf information

-- debsums errors found:
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 1581 package 
'anag':
 missing architecture
dpkg-query: warning: parsing file '/var/lib/dpkg/status' near line 29997 
package 'priv':
 missing architecture



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to