1

I have designed a message passing interface in c which is used to provide communication between different processes running in my system. This interface creates 10-12 threads for its purpose and use TCP sockets to provide communication.

It is working fine but sometimes it receives signal SIGTERM. Can anyone please tell me why is it receiving this signal.

hippietrail
  • 15,848
  • 18
  • 99
  • 158
honey
  • 11
  • 1
  • 2
  • Is something directing a `kill` at your process? SIGTERM is the default signal. – wallyk Apr 19 '11 at 05:50
  • 1
    Maybe you could,in your interface,register a handler for the signal and print the value of the pid of the process that sent the SIGTERM (struct siginfo_t.si_pid) inside the handler. – itisravi Apr 19 '11 at 05:53
  • noone is directing a kill to my process, it is receiving SIGTERM suddenly on its own – honey Apr 19 '11 at 06:03
  • i have the handler for SIGTERM but it is only printing the signal no. i've received and that is 15. – honey Apr 19 '11 at 06:06
  • well the print the pid instead.Use sigaction() instead of signal() to register the handler. – itisravi Apr 19 '11 at 06:45

1 Answers1

1

If a human isn't killing your process, then the kernel is.

This can happen when a machine is trying to save itself from drowning (you've used up all the memory/swap/resources). Might want to look at what's going on on that system when your process is running.

Brian Roach
  • 76,169
  • 12
  • 136
  • 161