src/timer.c
/************************************************************************/
/*                                                                      */
/*                         p a n i c u r a i d                          */
/*                                                                      */
/*   Most of the unused process-killing interrupts end up here; you     */
/*      can't do a whole lot safely here but dump your sysout for       */
/*      post-mortem analysis, but you MIGHT be able to get a clue       */
/*      about what killed you.                                          */
/*                                                                      */
/************************************************************************/
p a n i c u r a i d

Most of the unused process-killing interrupts end up here; you
can't do a whole lot safely here but dump your sysout for
post-mortem analysis, but you MIGHT be able to get a clue
about what killed you.
p a n i c u r a i d Most of the unused process - killing interrupts end up here ; you can ' t do a whole lot safely here but dump your sysout for post - mortem analysis but you MIGHT be able to get a clue about what killed you .
void panicuraid(int sig, siginfo_t *info, void *context)
{
  static char errormsg[200];
  static char *stdmsg =
      "Please record the signal and code information\n\
and do a 'v' before trying anything else.";
  switch (sig) {
    case SIGBUS:
    case SIGILL:
    case SIGSEGV:
      snprintf(errormsg, sizeof(errormsg), "%s at address %p.\n%s", strsignal(sig), info->si_addr, stdmsg);
      break;
    case SIGPIPE:
      snprintf(errormsg, sizeof(errormsg), "Broken PIPE.\n%s", stdmsg);
      break;
    case SIGHUP:
      snprintf(errormsg, sizeof(errormsg), "HANGUP signalled.\n%s", stdmsg);
      killpg(getpgrp(), SIGKILL);
      exit(0);
      break;
    case SIGFPE:
      snprintf(errormsg, sizeof(errormsg), "%s (%d) at address %p.\n%s", strsignal(sig), info->si_code, info->si_addr, stdmsg);
      break;
    default: snprintf(errormsg, sizeof(errormsg), "Uncaught SIGNAL %s (%d).\n%s", strsignal(sig), sig, stdmsg);
  }
  error(errormsg);
}
void panicuraid ( int sig , siginfo_t * info , void * context ) { static char errormsg [ 200 ] ; static char * stdmsg = " \n \
 " ; switch ( sig ) { case SIGBUS : case SIGILL : case SIGSEGV : snprintf ( errormsg , sizeof ( errormsg ) , " \n " , strsignal ( sig ) , info -> si_addr , stdmsg ) ; break ; case SIGPIPE : snprintf ( errormsg , sizeof ( errormsg ) , " \n " , stdmsg ) ; break ; case SIGHUP : snprintf ( errormsg , sizeof ( errormsg ) , " \n " , stdmsg ) ; killpg ( getpgrp ( ) , SIGKILL ) ; exit ( 0 ) ; break ; case SIGFPE : snprintf ( errormsg , sizeof ( errormsg ) , " \n " , strsignal ( sig ) , info -> si_code , info -> si_addr , stdmsg ) ; break ; default : snprintf ( errormsg , sizeof ( errormsg ) , " \n " , strsignal ( sig ) , sig , stdmsg ) ; } error ( errormsg ) ; }
p a n i c u r a i d
p a n i c u r a i d
/* Assume that a user tried to exit UNIX shell */