title: Why i am getting continuous SIGSEGV in the below C code
body: <p>I am trying to learn Signals. I know invalid memory access will cause segfault. So, I register a signal handler for SIGSEGV signal. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;signal.h&gt;
  
  
  void sighandler(int signum)
  {
      printf("%s\n", __func__);
  }
  
  int main()
  {
      int *a = NULL;
      signal(SIGSEGV, sighandler);
      *a = 5;
      return 0;
  }
  </code></pre>
  
  <p>Running this code, I am continuously getting SIGSEGV Signals. I thought i should only get the signal once. Can you guys explain why I am getting signals continuously</p>