Re: FATAL: Received Segment Violation...dying.

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 30 Jul 1998 22:07:32 +0200

Chris Wedgwood wrote:

> Only, I never seen any core. Any ideas on why this might be?

Probably the standard cause... started as root and using
cache_effective_user.

Don't start Squid as root if you'd like coredumps.

> One other idea I have, is to attach gdb to the process and leave it
> running. When a signal is delivered, gdb will catch it and I can
> examine things then, but core is much preferred.

Actually not a stupid idea even if you get coredumps. I did have
automated gdb dumps when I ran Squid (and cached before Squid wa
born) and had RunCache to send emails to me each time the proxy
died (including stacktraces).

How:

1. Change runcache to
   a) cd to a known directory
   b) start squid by using gdb
2. Place a .gdbinit file in the directory from 1a, and place all gdb
   commands needed in this file. I actually had the runcache build
   this to include things configured in RunCache without to much pain.

RunCache modifications:

From:
        squid -sY $conf ...
To:
        # Go to a well known directory
        cd $prefix
        # Program gdb to run squid and get a stracktrace if it dies
        cat >.gdbinit << -EOF
                run -sY -C $conf
                bt
                signal SIGQUIT
                quit
                EOF
        # Run squid and have it watched by gdb
        gdb bin/squid >> $logdir/squid.out 2>&1
        # Mail a notification to chris@cybernet.co.nz
        tail -200 $logdir/squid.out | \
                mailx -s "Squid restarted `date +%m%d-%H%M`" \
                        chris@cybernet.co.nz

Maybe we should include a RunCacheDebug that does something similar to
this?
A lot of people seems to have problems getting a stacktrace...

/Henrik
Received on Tue Jul 29 2003 - 13:15:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:50 MST