mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
ast_coredumper: Add gzipping of binaries and display of signal info
The --tarball-coredump option now creates a gzipped tarball of coredumps processed, their results txt files and copies of /etc/os-release, /usr/sbin/asterisk, /usr/lib(64)/libasterisk* and /usr/lib(64)/asterisk as those files are needed to properly examine the coredump. The file will be named /tmp/asterisk.<timestamp>.coredumps.tar.gz or /tmp/asterisk-<uniqueid>.coredumps.tar.gz if --tarball-uniqueid was specified. Added dumps of *_siginfo to the top of the txt files so you can tell what signal was invoked. Change-Id: Ib9ee6d83592d4b1bc90cb3419a05376a88d1ded9
This commit is contained in:
@@ -63,9 +63,15 @@ DESCRIPTION
|
|||||||
from the existing coredumps.
|
from the existing coredumps.
|
||||||
|
|
||||||
--tarball-coredumps
|
--tarball-coredumps
|
||||||
Creates a gzipped tarball of all coredumps processed.
|
Creates a gzipped tarball of coredumps processed, their
|
||||||
The tarball name will be:
|
results txt files and copies of /etc/os-release,
|
||||||
/tmp/asterisk.<timestamp>.coredumps.tar.gz
|
/usr/sbin/asterisk, /usr/lib(64)/libasterisk* and
|
||||||
|
/usr/lib(64)/asterisk as those files are needed to properly
|
||||||
|
examine the coredump. The file will be named
|
||||||
|
/tmp/asterisk.<timestamp>.coredumps.tar.gz or
|
||||||
|
/tmp/asterisk-<uniqueid>.coredumps.tar.gz if
|
||||||
|
--tarball-uniqueid was specified.
|
||||||
|
WARNING: This file could 1gb in size!
|
||||||
|
|
||||||
--delete-coredumps-after
|
--delete-coredumps-after
|
||||||
Deletes all processed coredumps regardless of whether
|
Deletes all processed coredumps regardless of whether
|
||||||
@@ -377,12 +383,25 @@ for i in ${!COREDUMPS[@]} ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if $tarball_coredumps ; then
|
if $tarball_coredumps ; then
|
||||||
tf=/tmp/asterisk-$df.coredumps.tar
|
tf=/tmp/asterisk-$df.coredumps.tar.gz
|
||||||
echo "Creating $tf.gz"
|
echo "Creating $tf"
|
||||||
|
dest=/tmp/asterisk-$df
|
||||||
|
rm -rf $dest 2>/dev/null || :
|
||||||
|
libdir=usr/lib
|
||||||
|
[ -d /usr/lib64 ] && libdir+=64
|
||||||
|
mkdir -p $dest/tmp $dest/$libdir/asterisk $dest/etc $dest/usr/sbin
|
||||||
for i in ${!COREDUMPS[@]} ; do
|
for i in ${!COREDUMPS[@]} ; do
|
||||||
tar -uvf $tf "${COREDUMPS[@]}" 2>/dev/null
|
ln -s "${COREDUMPS[@]}" $dest/"${COREDUMPS[@]}"
|
||||||
|
cp "${COREDUMPS[@]}"*.txt $dest/tmp/
|
||||||
done
|
done
|
||||||
gzip $tf
|
cp /etc/os-release $dest/etc/
|
||||||
|
cp -a /$libdir/libasterisk* $dest/$libdir/
|
||||||
|
cp -a /$libdir/asterisk/* $dest/$libdir/asterisk/
|
||||||
|
cp -a /usr/sbin/asterisk $dest/usr/sbin
|
||||||
|
rm -rf $tf
|
||||||
|
tar -chzf $tf --transform="s/^[.]/$df/" -C $dest .
|
||||||
|
rm -rf $dest
|
||||||
|
echo "Created $tf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $delete_coredumps_after ; then
|
if $delete_coredumps_after ; then
|
||||||
@@ -431,21 +450,29 @@ class DumpAsteriskCommand(gdb.Command):
|
|||||||
pass
|
pass
|
||||||
print("!@!@!@! thread1.txt !@!@!@!\n")
|
print("!@!@!@! thread1.txt !@!@!@!\n")
|
||||||
try:
|
try:
|
||||||
|
gdb.execute("p $_siginfo", from_tty)
|
||||||
|
gdb.execute("info signal $_siginfo.si_signo")
|
||||||
gdb.execute("thread apply 1 bt full", from_tty)
|
gdb.execute("thread apply 1 bt full", from_tty)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
print("!@!@!@! brief.txt !@!@!@!\n")
|
print("!@!@!@! brief.txt !@!@!@!\n")
|
||||||
try:
|
try:
|
||||||
|
gdb.execute("p $_siginfo", from_tty)
|
||||||
|
gdb.execute("info signal $_siginfo.si_signo")
|
||||||
gdb.execute("thread apply all bt", from_tty)
|
gdb.execute("thread apply all bt", from_tty)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
print("!@!@!@! full.txt !@!@!@!\n")
|
print("!@!@!@! full.txt !@!@!@!\n")
|
||||||
try:
|
try:
|
||||||
|
gdb.execute("p $_siginfo", from_tty)
|
||||||
|
gdb.execute("info signal $_siginfo.si_signo")
|
||||||
gdb.execute("thread apply all bt full", from_tty)
|
gdb.execute("thread apply all bt full", from_tty)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
print("!@!@!@! locks.txt !@!@!@!\n")
|
print("!@!@!@! locks.txt !@!@!@!\n")
|
||||||
try:
|
try:
|
||||||
|
gdb.execute("p $_siginfo", from_tty)
|
||||||
|
gdb.execute("info signal $_siginfo.si_signo")
|
||||||
gdb.execute("show_locks", from_tty)
|
gdb.execute("show_locks", from_tty)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user