[Samba] Strange crashes and disconnection from PDC?
Nir Soffer
nirs at exanet.com
Sun Jul 28 05:59:01 GMT 2002
Cc:'d to samba-technical
( Background - I'm trying to see how I can get smbd to dump core,
with a user supplied option to allow tell it where to dump it, I'm
poring over the related code)
> A 'corefile directory' option might be nice - but we will have to be
> careful. Look into smb_panic() and exit_server() for somewhere to
> start.
Err. Okay. Can anyone explain me what's up here? From server.c
#if DUMP_CORE
/*******************************************************************
Prepare to dump a core file - carefully !
********************************************************************/
static BOOL dump_core(void)
{
char *p;
pstring dname;
pstrcpy(dname,lp_logfile());
if ((p=strrchr(dname,'/'))) *p=0;
pstrcat(dname,"/corefiles");
mkdir(dname,0700);
sys_chown(dname,getuid(),getgid());
chmod(dname,0700);
if (chdir(dname)) return(False);
umask(~(0700));
dump_core is already there, DUMP_CORE is set to 1 (it looks like this
is the default one shipped, btw), yet nothing bloody happens.
The above snippet appears to create a corefiles directory above the log
dir, (which is, I assume, what you want to change using the core
directory
option), but it doesn't create it anywhere I can see after killing a
process with
sig11. What am I missing here?
Also - from what I see, the execution flow of a panic is something like:
exit_servers is set is a fault handler, however in fault_setup (fault.c)
a
SIGSEGV handler is set to sig_fault which calls fault_report which
calls smb_panic which calls abort().
When the heck is exit_servers called, then? And what function does
dump_core perform if there's no one to call it?
I'm probably missing something fundamental here, enlightment will
be appreciated.
Thanks,
Nir.
--
Nir Soffer -=- Software Engineer, Exanet Inc. -=-
"Father, why are all the children weeping? / They are merely crying son
O, are they merely crying, father? / Yes, true weeping is yet to come"
-- Nick Cave and the Bad Seeds, The Weeping Song>
More information about the samba-technical
mailing list