2

I'm currently debugging my daemon that supposedly die due to SIGKILL.

I'd like to catch that signal that is intended for my process and add a printout that this process got .

I'm aware that SIGKILL cannot be caught in process level signal handler, so I've decided to use kext.

I've looked in xnu source code and saw that psignal is the method that passes the signal to the target process. However, so I've tried to use trampoline to patch it, but this method is only calls another static method named psignal_internal that is static, and it's probably eliminated by compiler optimization.

perhaps there are other ways to get some sort of mechanism that may help catching this event of sigkill and maybe provide option to set a proper callback function in this case?

thanks

Liviu
  • 1,859
  • 2
  • 22
  • 48
  • Have you investigated using dtrace for this? I'm not sure if it's any help for catching signals, but it can certainly grab stack traces. – pmdj Dec 07 '16 at 13:41

0 Answers0