- 论坛徽章:
- 0
|
[HP-UX 11.00]
Working in HP-UX 11.00 server, recently we encounter a strange problem that a process always dies surprisingly. Look at the following C codes in the process:
signal( SIGALRM, timesup ); /* Setup a timer */
alarm( 5 );
if ((n = send( wall.sockfd, messages, len, 0 )) != len )
printf ( \"%s: Cannot send to Wall %d - ERROR %d\\n\", FUNC, i+1, errno );
else
printf ( \"%s: Wall %d!\\n\", __FILE__, i+1 );
alarm( 0 );
The codes are to send a simple message from our HP-UX server to a remote PC. The signal handler of SIGALRM timesup() is defined in the main() module.
To our surprise, as soon as the remote PC is restarted and the server process is about to \"send\", the entire process will die. However, in line with the source codes, the process will print the following log info:
printf ( \"%s: Cannot send to Wall %d - ERROR %d\\n\", __FILE__, i+1, errno );
other than die.
Somebody estimates that maybe some fatal signals, e.g., SIGFPE, SIGSEGV, _SIGPIPE and so on were being delivered to the process at that moment. Nevertheless, I can not image there are those signals generated as soon as the remote PC is restarted.
Which expert can give me any idea on this issue? |
|