Handling Signals
If your program contains a signal handler routine, you may need to adjust the way TotalView handles signals. The following table shows how TotalView handles UNIX signals by default:
Signals Passed Back to Your Program | Signals Treated as Errors |
---|
SIGHUP | SIGIO | SIGILL | SIGPIPE |
SIGINT | SIGIO | SIGTRAP | SIGTERM |
SIGQUIT | SIGPROF | SIGIOT | SIGTSTP |
SIGKILL | SIGWINCH | SIGEMT | SIGTTIN |
SIGALRM | SIGLOST | SIGFPE | SIGTTOU |
SIGURG | SIGUSR1 | SIGBUS | SIGXCPU |
SIGCONT | SIGUSR2 | SIGSEGV | SIGXFSZ |
SIGCHLD | | SIGSYS | |
NOTE: TotalView uses the SIGTRAP and SIGSTOP signals internally. If a process receives either of these signals, TotalView neither stops the process with an error nor passes the signal back to your program. You cannot alter the way TotalView uses these signals.
On some systems, hardware registers affect how TotalView and your program handle signals such as
SIGFPE. For more information, see
Interpreting the Status and Control Registers and the
“Architectures” chapter in the
Classic TotalView Reference Guide.
NOTE: On an SGI computer, setting the
TRAP_FPE environment variable to any value indicates that your program traps underflow errors. If you set this variable, however, you also need to use the controls in the
File > Signals Dialog Box to indicate what TotalView should do with
SIGFPE errors. (In most cases, you set
SIGFPE to
Resend.)
You can change the signal handling mode using the
File > Signals command,
Figure 48.
The signal names and numbers that TotalView displays are platform-specific. That is, what you see in this box depends on the computer and operating system in which your program is executing.
You can change the default way in which TotalView handles a signal by setting the
TV::signal_handling_mode variable in a
.tvdrc startup file.
When your program receives a signal, TotalView stops all related processes. If you don’t want this behavior, clear the
Stop control group on error signal check box on the Options Page of the
File > Preferences Dialog Box.
When your program encounters an error signal, TotalView opens or raises the Process Window. Clearing the Open process window on error signal check box, also found on the Options Page in the File > Preferences Dialog Box, tells TotalView not to open or raise windows.
If processes in a multi-process program encounter an error, TotalView only opens a Process Window for the first process that encounters an error. (If it did it for all of them, TotalView would quickly fill up your screen with Process Windows.)
If you select the
Open process window at breakpoint check box on the
File > Preferences Action Points
Page, TotalView opens or raises the Process Window when your program reaches a breakpoint.
Make your changes by selecting one of the radio buttons described in the following table.
Button | Description |
---|
Error | Stops the process, places it in the error state, and displays an error in the title bar of the Process Window. If you have also selected the Stop control group on error signal check box, TotalView also stops all related processes. Select this button for severe error conditions, such as SIGSEGV and SIGBUS. |
Stop | Stops the process and places it in the stopped state. Select this button if you want TotalView to handle this signal as it would a SIGSTOP signal. |
Resend | Sends the signal back to the process. This setting lets you test your program’s signal handling routines. TotalView sets the SIGKILL and SIGHUP signals to Resend since most programs have handlers to handle program termination. |
Ignore | Discards the signal and continues the process. The process does not know that something raised a signal. |
NOTE: Do not use Ignore for fatal signals such as SIGSEGV and SIGBUS. If you do, TotalView can get caught in a signal/resignal loop with your program; the signal immediately reoccurs because the failing instruction repeatedly re-executes.