Handling SIGUSR2 signal

HI,

I need to handle SIGUSR2 signal in my application to change the state of the application dynamically. I have implemented the signal handler. However the application is able to catch only one SIGUSR2 signal. The second SIGUSR2 signal causes the application to crash. This is happning only with SIGUSR2. Other signals, e.g. SIGCHLD, SIGIOT, are working fine. Can anyone tell me what is wrong with the SIGUSR2 signal?

Regards,
Diganta

If it only "crashes" with the one signal, that means you have a problem with whatever code is invoked for SIGUSR2.

What do you mean by crash? Core dump?

could you please let us know the semantics of signal which you are using?

is it through the old semantics
registering signal handlers using signal();

or through the new semantcis
registering the signals through masking the sigset and then using the sigaction handler

though new semantics of signals are constructed over the prevailing old semantics

there had always been a viable threat when using older semantics of signals
i) when the handlers of SIGUSR2 are used and then again encountered with SIGUSR2 the handlers need to re-registered that is the function address needs to re-presented to the kernel

ii) there had been no blocking and concept of delivering at a later pt of time with the concept of older semantics

iii) case is left for an unpredictable behaviour when handler for SIGUSR2 is being executed and while execution of the handler again a SIGUSR2 is delivered.

jim: As you had mentioned problem could be with the handler of SIGUSR2 but thats only a possibility. If it had been so, why it refused to crash in the first-handle?

M - You're correct, it can be the use of signal(). But without code I have no clue what's going on.