title: Signal not caught when sending SIGUSR1 or SIGINT to stopped process until you continue the process -- why?
body: <p>Why is it that when you stop a process and then try to terminate it with SIGUSR1 or SIGINT, the signal isn't caught until you send SIGCONT? But when you terminate it with SIGKILL, the signal is caught right away?</p>
  
  <p>In our own shell, we followed this in gdb. The signal isn't caught at all until continuing the process. Our SIGCHLD handler for the parent process caught it after we sent a SIGCONT signal, and WIFSIGNALED(status) for the child process returned true (meaning the signal wasn't caught before, right?).</p>
  
  <p>Regular Linux shell sending SIGUSR1 to a stopped process:</p>
  
  <pre><code>$ ./testing 30
  ^Z
  [1]+  Stopped                 ./testing 30
  $ ps
    PID TTY          TIME CMD
   2775 pts/2    00:00:00 bash
   4668 pts/2    00:00:00 testing
   4669 pts/2    00:00:00 ps
  $ kill -SIGUSR1 4668
  $ ps
    PID TTY          TIME CMD
   2775 pts/2    00:00:00 bash
   4668 pts/2    00:00:00 testing
   4670 pts/2    00:00:00 ps
  $ kill -SIGCONT 4668
  $ ps
    PID TTY          TIME CMD
   2775 pts/2    00:00:00 bash
   4671 pts/2    00:00:00 ps
  [1]+  User defined signal 1   ./testing 30
  $ 
  </code></pre>
  
  <p>Regular Linux shell sending SIGINT to a stopped process:</p>
  
  <pre><code>$ ./testing 30
  ^Z
  [1]+  Stopped                 ./testing 30
  $ ps
    PID TTY          TIME CMD
   2775 pts/2    00:00:00 bash
   4691 pts/2    00:00:00 testing
   4692 pts/2    00:00:00 ps
  $ kill -SIGINT 4691
  $ ps
    PID TTY          TIME CMD
   2775 pts/2    00:00:00 bash
   4691 pts/2    00:00:00 testing
   4702 pts/2    00:00:00 ps
  $ kill -SIGCONT 4691
  $ ps
    PID TTY          TIME CMD
   2775 pts/2    00:00:00 bash
   4703 pts/2    00:00:00 ps
  [1]+  Interrupt               ./testing 30
  $
  </code></pre>
  
  <p>Regular Linux shell sending SIGKILL to a stopped process:</p>
  
  <pre><code>$ ./testing 30
  ^Z
  [1]+  Stopped                 ./testing 30
  $ ps
    PID TTY          TIME CMD
   5243 pts/2    00:00:00 bash
   5331 pts/2    00:00:00 testing
   5332 pts/2    00:00:00 ps
  $ kill -SIGKILL 5331
  $ ps
    PID TTY          TIME CMD
   5243 pts/2    00:00:00 bash
   5334 pts/2    00:00:00 ps
  [1]+  Killed                  ./testing 30
  $
  </code></pre>