Re: Why I could not catch the signals on HP_UX?
From: Sandy (whoknowsace_at_yahoo.com)
Date: 06/28/05
- Next message: Ulrich.Teichert_at_gmx.de: "Re: Why I could not catch the signals on HP_UX?"
- Previous message: Martin Jost: "Re: Problems with HP Visualize C3000"
- In reply to: Dennis Handly: "Re: Why I could not catch the signals on HP_UX?"
- Next in thread: Ulrich.Teichert_at_gmx.de: "Re: Why I could not catch the signals on HP_UX?"
- Reply: Ulrich.Teichert_at_gmx.de: "Re: Why I could not catch the signals on HP_UX?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Jun 2005 10:11:19 -0700
Thanks for all your suggestions.
I have set the following signals in the main() :
void setSignals()
{
int signum;
struct sigaction vec;
for (signum = 1; signum <= NSIG; signum++)
{
(void) signal(signum, SIG_IGN);
}
sigemptyset( &vec.sa_mask );
sigaddset( &vec.sa_mask, SIGCHLD );
vec.sa_flags = 0;
vec.sa_handler = serverExitSignalHandler
/** CAPTURE TERMINAL SIGNAL EVENTS **/
if (sigaction(SIGTERM,&vec,NULL) == -1 ||
#if defined(SIGEMT_SUPPORTED)
sigaction(SIGEMT,&vec,NULL) == -1 ||
#endif /* defined(SIGEMT_SUPPORTED) */
sigaction(SIGFPE,&vec,NULL) == -1 ||
sigaction(SIGILL,&vec,NULL) == -1 ||
sigaction(SIGPIPE,&vec,NULL) == -1 ||
sigaction(SIGALRM,&vec,NULL) == -1 ||
sigaction(SIGINT,&vec,NULL) == -1 ||
sigaction(SIGPOLL,&vec,NULL) == -1 ||
sigaction(SIGPROF,&vec,NULL) == -1 ||
sigaction(SIGUSR2,&vec,NULL) == -1 ||
sigaction(SIGVTALRM,&vec,NULL) == -1 ||
sigaction(SIGQUIT,&vec,NULL) == -1 ||
//sigaction(SIGBUS,&vec,NULL) == -1 ||
//sigaction(SIGSEGV,&vec,NULL) == -1 ||
sigaction(SIGSYS,&vec,NULL) == -1)
/*sigaction(SIGCHLD,&vec,NULL) == -1 )*/
{
exit (1);
}
// Handle special case of SIGSEGV and SIGBUS when it occurs in
NotifyObservers
vec.sa_handler = notExitSigHandler;
if ( sigaction(SIGBUS,&vec,NULL) == -1 ||
sigaction(SIGSEGV, &vec, NULL) == -1 ||
sigaction(SIGABRT, &vec, NULL) == -1 ||
sigaction(SIGHUP, &vec, NULL) == -1)
{
exit(1);
}
vec.sa_handler=dbgHandler;
if (sigaction(SIGUSR1,&vec,NULL) == -1)
{
exit (1);
}
}
The callback is on anther thread, but I tried to do a raise(SIGSEGV) in
the server's call back function just to test if the server can catch
the signal. I found it get and the notExitSigHandler() is called. But
in real case, which mean when I call the callback using the client's
invalid object, the server is terminated without catching any signal
first.
The callback is a CORBA callback, Sometimes, I got a CORBA exception,
but not always. (I think it is a bug in CORBA.), other times, I have
the problem that I described above. I am trying to cover that problem
in my code by catching the signal and redirect it to my handler instead
of the system default handler. I want the code to continue to do
callback to other clients in the list instead of just terminates the
process. So the notExitSigHandler is to throw an exception to the
server's callback function... But since I can not catch this signal, I
can not do anything about it.
Thanks
Sandy
- Next message: Ulrich.Teichert_at_gmx.de: "Re: Why I could not catch the signals on HP_UX?"
- Previous message: Martin Jost: "Re: Problems with HP Visualize C3000"
- In reply to: Dennis Handly: "Re: Why I could not catch the signals on HP_UX?"
- Next in thread: Ulrich.Teichert_at_gmx.de: "Re: Why I could not catch the signals on HP_UX?"
- Reply: Ulrich.Teichert_at_gmx.de: "Re: Why I could not catch the signals on HP_UX?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|