title: WIFSIGNALED not catching SEGFAULT signal
body: <p>Im fairly certain of what WIFEXITED and WIFSIGNALED are and how they work. I dont know why its not working since the program does a segfault, and I can very well see(debugged) that that signal on the third while iteration is a SEGFAULT. Thanks for any info.</p>
  <p>segfault_prog</p>
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  int main() {
          int *i = 0x478734;
          printf(&quot;%d&quot;, *i);
  }
  </code></pre>
  <pre><code>int main(void) {
      int status;
      int ret = fork();
  
      if (ret == 0) {
          ptrace(PTRACE_TRACEME, ret, NULL, NULL);
          raise(SIGSTOP);
          execve(argv[1], &amp;argv[1], NULL);
          return 1;
      }
      else {
          while (1) {
              pid_t val = waitpid(ret, &amp;status, 0);
              ptrace(PTRACE_SETOPTIONS, ret, 0,PTRACE_O_EXITKILL | PTRACE_O_TRACEEXEC);
  
              if (WIFEXITED(status) &amp;&amp; val == ret){
                  printf(&quot;exited normally&quot;);
                  return WEXITSTATUS (status);
              }
              else if (WIFSIGNALED(status)){
  //if I change for WEXITSTATUS(status) == SIGSEGV. then it works. First while iteration wIFEXITVAL(SIGSTOP/19), 2nd (SIGTRAP/5), 3rd (SIGSEGV 11);
                  printf(&quot;signal error&quot;);
                  return WEXITSTATUS (status);
              }
  
              ptrace(PTRACE_CONT, val, 0, 0);
          }
      }
      return (0);
  }
  </code></pre>