[Asterisk-code-review] ast coredumper: Add gzipping of binaries and display of sig... (asterisk[15])

George Joseph asteriskteam at digium.com
Wed Oct 25 12:28:12 CDT 2017


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/6919


Change subject: ast_coredumper:  Add gzipping of binaries and display of signal info
......................................................................

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
---
M contrib/scripts/ast_coredumper
1 file changed, 34 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/19/6919/1

diff --git a/contrib/scripts/ast_coredumper b/contrib/scripts/ast_coredumper
index 81e94e9..e5fc44e 100755
--- a/contrib/scripts/ast_coredumper
+++ b/contrib/scripts/ast_coredumper
@@ -63,9 +63,15 @@
 		from the existing coredumps.
 
 	--tarball-coredumps
-		Creates a gzipped tarball of all coredumps processed.
-		The tarball name will be:
-		/tmp/asterisk.<timestamp>.coredumps.tar.gz
+		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.
+		WARNING:  This file could 1gb in size!
 
 	--delete-coredumps-after
 		Deletes all processed coredumps regardless of whether
@@ -377,12 +383,25 @@
 done
 
 if $tarball_coredumps ; then
-	tf=/tmp/asterisk-$df.coredumps.tar
-	echo "Creating $tf.gz"
+	tf=/tmp/asterisk-$df.coredumps.tar.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
-		tar -uvf $tf "${COREDUMPS[@]}" 2>/dev/null
+		ln -s "${COREDUMPS[@]}" $dest/"${COREDUMPS[@]}"
+		cp "${COREDUMPS[@]}"*.txt $dest/tmp/
 	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
 
 if $delete_coredumps_after ; then
@@ -431,21 +450,29 @@
             pass
         print("!@!@!@! thread1.txt !@!@!@!\n")
         try:
+            gdb.execute("p $_siginfo", from_tty)
+            gdb.execute("info signal $_siginfo.si_signo")
             gdb.execute("thread apply 1 bt full", from_tty)
         except:
             pass
         print("!@!@!@! brief.txt !@!@!@!\n")
         try:
+            gdb.execute("p $_siginfo", from_tty)
+            gdb.execute("info signal $_siginfo.si_signo")
             gdb.execute("thread apply all bt", from_tty)
         except:
             pass
         print("!@!@!@! full.txt !@!@!@!\n")
         try:
+            gdb.execute("p $_siginfo", from_tty)
+            gdb.execute("info signal $_siginfo.si_signo")
             gdb.execute("thread apply all bt full", from_tty)
         except:
             pass
         print("!@!@!@! locks.txt !@!@!@!\n")
         try:
+            gdb.execute("p $_siginfo", from_tty)
+            gdb.execute("info signal $_siginfo.si_signo")
             gdb.execute("show_locks", from_tty)
         except:
             pass

-- 
To view, visit https://gerrit.asterisk.org/6919
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9ee6d83592d4b1bc90cb3419a05376a88d1ded9
Gerrit-Change-Number: 6919
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171025/6e7e7d6d/attachment.html>


More information about the asterisk-code-review mailing list