Title: Nachricht
 
-----Original Message-----
From: Rubino Gei� [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 8:48 AM
To: 'Srikanth Vishwanathan'
Subject: RE: [OpenAFS] Errors: Fileserver freezes, Volumes contains orphans

Yes, this might work, but most certainly not: the fileserver was not dying on kill -KILL so why should he be reacting to some else signal? Anyway, I will give it a try.
 
Bye, Ruby
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Srikanth Vishwanathan
Sent: Friday, January 31, 2003 3:55 AM
To: [EMAIL PROTECTED]
Subject: RE: [OpenAFS] Errors: Fileserver freezes, Volumes contains orphans


> for starters, the LWP fileserver (if you build openafs, find it in
> src/viced/fileserver) will actually leave a core, unlike the pthreaded
> fileserver, if it dies. if as i'm guessing you have one pthread dying now
> this may help.

The LWP fileserver might drop a core, but it usually doesn't show the
stack trace of the LWP that caused the problem.

There's also this other trick for getting a multithreaded application
to dump core that I read about in some Linux newsgroup. The trick is to
register signal handlers for signals like ABRT, SEGV and BUS and have
the signal handler kill all the other threads before attempting to dump
core. This doesn't always work, but has helped me debug some Linux
problems.

int signal_handler(int num)
{
        struct sigaction new_action;

        pthread_kill_other_threads_np();
       
        sleep(1);

        /* Restore default handler for abort */        
        sigemptyset(&new_action.sa_mask);
        new_action.sa_handler = SIG_DFL;
        new_action.sa_flags = 0;
        sigaction(SIGABRT, &new_action, NULL);

        abort();
}

And in main()

int main()
{
.
.
        struct sigaction new_action;

        sigemptyset(&new_action.sa_mask);
        new_action.sa_handler = error_handler;
        new_action.sa_flags = 0;

        sigaction(SIGABRT, &new_action, NULL);
        sigaction(SIGSEGV, &new_action, NULL);
        sigaction(SIGBUS, &new_action, NULL);

        pthread_create(...        
}

Reply via email to