Automatic backtrace [Was: Re: NetAPP/Samba 3.0/plugs]

Scott Gifford sgifford at
Wed Mar 13 01:43:04 GMT 2002

Andrew Bartlett <abartlet at> writes:

> Scott Gifford wrote:
> > 
> > Andrew Bartlett <abartlet at> writes:
> > 
> > > David Lee wrote:
> > 
> > [...]
> > 
> > > > 3. If "gdb" (or similar) is found and "--enable-debug" is set, then the
> > > >    default panic action could be to invoke gdb (or other debugger) with
> > > >    the relevant subcommands to perform and log the backtrace.
> > > >
> > > > Sure, that probably needs refinement.  But for the moment read it for the
> > > > positive possibilities not the worrying nitpicks.
> > > >
> > > > Promising?  Or an unrealistic non-starter?
> > >
> > > Quite promising, and it would *really* help with our debugging.
> > 
> > Perhaps I'm missing something obvious, but why not just let Samba dump
> > core?...It's straightforward to provide a backtrace from a core file.
> Where?  Under what uid?  Following what symlinks?  

All of this is handled by the OS, and core is dumped in the current
working directory.  I don't know how Samba decides what directories to
chdir() into, but if it wanders around a bit, something like
chdir("/some/known/directory"); abort(); in a signal handler will make
sure that the corefile ends up in a sane place.

> Dumping core just has 'bad idea' written all over it.

It seem to me that investing a lot of time into designing something
that gives the equivalent functionality of core files has 'reinventing
the wheel' written all over it...

> Plus the people who know how to use gdb on a core file would already
> have a magic 'panic action' already setup.

Perhaps, but I know how to use gdb on a core file, and I have no idea
what a reasonable thing to put in 'panic action' would be...It's tempting
to say that's because of my ignorance of Samba, but it's equally
tempting to say that it's because Samba behaves in a nonstandard


More information about the samba-technical mailing list