Woof!

On Mon, Jan 24, 2011 at 9:46 PM, Douglas Hubler <[email protected]> wrote:

> >So maybe this is better:
>
>  struct sigaction sig_actions;
>  sig_actions.sa_handler = shutdown_handler;
>  sigemptyset(&sig_actions.sa_mask);
>  sig_actions.sa_flags = 0;
>  int register_sig_action = sigaction(SIGTERM, &sig_actions, NULL);
>

I would really like to use a debugger but also understand why sipXecs
> daemons are so different than any others.


It is a conundrum.  It's been that way for a long time, and I never did
figure it out (the debug issues preceded the signal handling thread design,
BTW).  For non IMDB using code, this is probably fine.  But the IMDB code
isn't re-entrant, and so if SIGTERM is caught while in IMDB, one cannot then
call the IMDB cleanup code without possible locking issues.  That was
the impetus for the new signal handling thread model, to make sure IMDB
threads could NOT be the one that ended up calling the shutdown_handler.

I believe one can tell gdb to ignore certain signals, and perhaps that is
something to explore.  I used to have a gcc 'rc' file set stuff up and it
was usable.  I don't have them anymore and don't recall exactly, but it was
something like "handle <signal> ignore" (or was it nostop?)

--Woof!
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/

Reply via email to