title: segmentation fault handler crashes with segmentation fault
body: <p>I am using arm machine and segmentation handler sometimes crashes while obtaining crash context address:</p>
  
  <pre><code>void crit_err_hdlr(int sig_num, siginfo_t * info, void * ucontext)
  {
   uintptr_t fault_address = NULL;
   struct sigcontext *ctx = &amp;(((ucontext_t*)ucontext)-&gt;uc_mcontext);
   fault_address = ctx-&gt;arm_pc;
  
   //after reading ctx-&gt;arm_pc it crashes
  }
  </code></pre>
  
  <p>This is how handler is setup:</p>
  
  <pre><code>struct sigaction sigact = { 0 };
  sigact.sa_sigaction = crit_err_hdlr;
  sigact.sa_flags = SA_SIGINFO |  SA_RESTART;
  if (sigaction(SIGSEGV, &amp;sigact, (struct sigaction *)NULL) != 0)
  {
   //error, bail out
  }
  </code></pre>
  
  <p>Is there any possible way to check if arm_pc filed in sigcontext is readable, so I can avoid the crash in crash handler?</p>