Thursday, October 13, 2011

What do I do with this core file?

Use this script to generate a useful backtrace from the core file.

#!/bin/bash

corefile=$1
outfile=$1.gdbtrace.log

function getprocess {

        commandstring=$(gdb -c $corefile \
                --eval-command='set pagination off' \
                --eval-command='bt' \
                --eval-command='quit' \
                |awk '/Core was generated by/ { split($0, a, "`"); split(a[2], b, "'\''"); split(b[1], c, " "); print c[1] }')

        echo $commandstring|awk '{print $1}'
}


if [ -a $corefile ] ; then
        process=$(getprocess)
else
        echo You must provide a core file as an argument
        exit
fi

if [ -a $process ] ; then

echo Core was generated by $process

gdb $process \
                -c $corefile \
                --eval-command='set pagination off' \
                --eval-command="set logging file $outfile" \
                --eval-command='set logging on' \
                --eval-command='bt' \
                --eval-command='bt full' \
                --eval-command='thread apply all bt' \
                --eval-command='thread apply all bt full' \
                --eval-command='quit'

echo "Trace written to $outfile"

else
        echo "Can not find $process. This script my be broken, or the file disappeared."
        exit
fi

Tuesday, March 22, 2011

German exit signs

I've made my way to Frankfurt, Germany. Tomorrow I will be taking the train to Regensburg. I will post all of my photos on my photo sharing site later here.

All throughout the airport I've seen these exit signs and they reminded me of the signs you see inside the game Portal.

Here is a picture of one of the signs. (I didn't take this picture. I can't get my memory card reader to work right now.)


And here is a logo for the game: