From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23463 invoked by alias); 1 Aug 2013 23:05:43 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 23438 invoked by uid 89); 1 Aug 2013 23:05:42 -0000 X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mout.gmx.net) (212.227.17.22) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 01 Aug 2013 23:05:42 +0000 Received: from [192.168.100.4] ([198.91.151.130]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LdpZX-1UMaQo0RgB-00j1zg for ; Fri, 02 Aug 2013 01:05:33 +0200 Message-ID: <51FAE9BA.9040902@gmx.net> Date: Thu, 01 Aug 2013 23:05:00 -0000 From: Aurelian Melinte User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100722 Eudora/3.0.4 MIME-Version: 1.0 To: gdb@sourceware.org CC: Paul Smith Subject: Re: Tools to classify / uniquify core dumps or stack traces? References: <1375385181.3028.5.camel@homebase> <20130801193547.GA12116@host2.jankratochvil.net> In-Reply-To: <20130801193547.GA12116@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00002.txt.bz2 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` " 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