From: Aurelian Melinte <ame01@gmx.net>
To: gdb@sourceware.org
Cc: Paul Smith <psmith@gnu.org>
Subject: Re: Tools to classify / uniquify core dumps or stack traces?
Date: Thu, 01 Aug 2013 23:05:00 -0000 [thread overview]
Message-ID: <51FAE9BA.9040902@gmx.net> (raw)
In-Reply-To: <20130801193547.GA12116@host2.jankratochvil.net>
On 01/08/2013 3:35 PM, Jan Kratochvil wrote:
> On Thu, 01 Aug 2013 21:26:21 +0200, Paul Smith wrote:
>
>> Hi all. I've got an environment where I'm getting lots of core dumps
>> from various places and it's very tedious to go through them and
>> determine which ones are for unique problems, and which are essentially
>> duplicates (same bug causing the core dump).
>>
>> I was thinking of throwing together some kind of Perl or Python script
>> that could compare and categorize stack traces, but I thought surely
>> someone must have done something like this before.
>>
>> Anyone have any pointers or thoughts about something like this?
>>
I use a home-brewed script - pasted below - to turn a collection of core
dumps into a report for each core. Then I sift manually through but
still much faster than analyzing core by core.
Regards,
a.
#!/bin/bash
#
# A script to extract core-file informations
#
if [ $# -ne 1 ]
then
echo "Usage:`basename $0` <for-binary-image>"
exit -1
else
binimg=$1
fi
# Today and yesterdays cores
cores=`find .-name '*.core' -mtime -1`
#cores=`find . -name '*.core'`
for corein $cores
do
gdblogfile="$core-gdb.log"
rm $gdblogfile
bininfo=`ls -l $binimg`
coreinfo=`ls -l $core`
gdb -batch \
-ex "set logging file$gdblogfile" \
-ex "set logging on" \
-ex "set pagination off" \
-ex "printf\"**\n** Process info for$binimg -$core \n** Generated`date`\n\"" \
-ex "printf\"**\n**$bininfo \n**$coreinfo\n**\n\"" \
-ex "file$binimg" \
-ex "core-file$core" \
-ex "bt" \
-ex "info proc" \
-ex "printf\"*\n* Libraries\n*\n\"" \
-ex "info sharedlib" \
-ex "printf\"*\n* Memory map\n*\n\"" \
-ex "info target" \
-ex "printf\"*\n* Registers\n*\n\"" \
-ex "info registers" \
-ex "printf\"*\n* Current instructions\n*\n\"" -ex "x/16i\$pc" \
-ex "printf\"*\n* Threads (full)\n*\n\"" \
-ex "info threads" \
-ex "bt" \
-ex "thread apply all bt full" \
-ex "printf\"*\n* Threads (basic)\n*\n\"" \
-ex "info threads" \
-ex "thread apply all bt" \
-ex "printf\"*\n* Done\n*\n\"" \
-ex "quit"
done
next prev parent reply other threads:[~2013-08-01 23:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 19:26 Paul Smith
2013-08-01 19:36 ` Jan Kratochvil
2013-08-01 23:05 ` Aurelian Melinte [this message]
2013-08-02 1:13 ` Paul Smith
2013-08-02 8:59 ` Phil Muldoon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51FAE9BA.9040902@gmx.net \
--to=ame01@gmx.net \
--cc=gdb@sourceware.org \
--cc=psmith@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox