Handling SIGUSR2 signal


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Handling SIGUSR2 signal
# 1  
Old 11-17-2005
Error 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
# 2  
Old 11-18-2005
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?
# 3  
Old 11-19-2005
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?
# 4  
Old 11-21-2005
M - You're correct, it can be the use of signal(). But without code I have no clue what's going on.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

problem in reforking and signal handling

hi friends i have a problem in signal handling ... let me explain my problem clearly.. i have four process .. main process forks two child process and each child process again forks another new process respectively... the problem is whenever i kill the child process it is reforking and the... (2 Replies)
Discussion started by: senvenugopal
2 Replies

2. UNIX and Linux Applications

SIGSEGV Signal handling

Hello, Can anybody tell me how can i handle segmentation fault signal, in C code? (2 Replies)
Discussion started by: mustus
2 Replies

3. Programming

Signal handling

I am trying to write a small program where I can send signals and then ask for an action to be triggered if that signal is received. For example, here is an example where I am trying to write a programme that will say you pressed ctrl*c when someone presses ctrl+c. My questions are what you would... (1 Reply)
Discussion started by: #moveon
1 Replies

4. Programming

Signal Handling and Context Switches

Hi guys, this is my first posting, so at first hi to everyone! ;) I have a problem with ucontext_t in connection with signal handling. I want to simulate a preemptive scheduler. I am using the iTimer with ITIMER_PROF, to schedule the interrupts. You find the code below: #include <stdio.h>... (18 Replies)
Discussion started by: XComp
18 Replies

5. Programming

signal handling while in a function other than main

Hi, I have a main loop which calls a sub loop, which finally returns to the main loop itself. The main loop runs when a flag is set. Now, I have a signal handler for SIGINT, which resets the flag and thus stops the main loop. Suppose I send SIGINT while the program is in subloop, I get an error... (1 Reply)
Discussion started by: Theju
1 Replies

6. Programming

signal handling question

Hello all, I am starting to learn signal handling in Linux and have been trying out some simple codes to deal with SIGALRM. The code shown below sets a timer to count down. When the timer is finished a SIGALRM is produced. The handler for the signal just increments a variable called count. This... (7 Replies)
Discussion started by: fox_hound_33
7 Replies

7. Shell Programming and Scripting

Signal handling in Perl

Guys, I'm doing signal handling in Perl. I'm trying to catch ^C signal inside the script. There two scripts : one shell script and one perl script. The shell script calls the perl script. For e.g. shell script a.sh and perl scipt sig.pl. Shell script a.sh looks something like this :... (6 Replies)
Discussion started by: obelix
6 Replies

8. Programming

Signal Handling

Hi folks I'm trying to write a signal handler (in c on HPUX) that will catch the child process launched by execl when it's finished so that I can check a compliance file. The signal handler appears to catch the child process terminating however when the signal handler completes the parent... (3 Replies)
Discussion started by: themezzaman
3 Replies

9. UNIX for Advanced & Expert Users

I have a problem using signal SIGUSR2

hi I have created a application which uses SIGUSR2. It send this signal to server and waits for signal SIGUSR2 from server after server performing some operation server sends SIGUSR2 back to the application. The application then quits. This works fine which ran from terminal , but when I... (3 Replies)
Discussion started by: khan_069
3 Replies

10. UNIX for Advanced & Expert Users

signal handling in shell script

Hi can any please tell me is it possible to catch the signal in a shell script like we do in C. if yes please give me some idea or a link. (4 Replies)
Discussion started by: Raom
4 Replies
Login or Register to Ask a Question