1

I am tracing a program using ptrace and that program crashes while running. I have written a code that prints stack trace of a pid. I am stuck at the point that I don't know when it is about to crash and when should I print the stack trace.

Could anyone suggest me what signal a dying program send to its parent? So I can write a signal handler.

Faizan Sh
  • 96
  • 1
  • 13

1 Answers1

0

The tracer may call waitpid(child_pid, ...), when the waited tracee gets killed by signal, waitpid would return WIFSIGNALED, so you can add your code there.

wbj
  • 21
  • 1
  • 3