Changeset 14484


Ignore:
Timestamp:
Dec 15, 2010, 2:01:57 AM (10 years ago)
Author:
rme
Message:

When in batch mode, reset the signal action for SIGSEGV and SIGBUS
to the default before trying to print a backtrace in the lisp kernel
debugger. The idea is to avoid looping on "unhandled exception 11"
or whatever when trying to print out a trashed call stack.

Also print version information before the backtrace, so that we see
it if printing the backtrace fails.

Location:
trunk/source/lisp-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/lisp-debug.c

    r14352 r14484  
    14211421    }
    14221422    debug_memory_areas(xp, info, 0);
     1423    debug_show_lisp_version(xp, info, 0);
    14231424    debug_backtrace(xp, info, 0);
    1424     debug_show_lisp_version(xp, info, 0);
    1425 
    14261425    abort();
    14271426  }
  • trunk/source/lisp-kernel/xlbt.c

    r13067 r14484  
    1717#include "lispdcmd.h"
    1818#include <stdio.h>
     19#include <signal.h>
    1920
    2021
     
    105106    } else {
    106107      if (start->backlink) {
    107         fprintf(dbgout, "Bogus  frame %lx\n", start);
     108        fprintf(dbgout, "Bogus frame %lx\n", start);
    108109      }
    109110      return;
     
    155156  } else {
    156157    fprintf(dbgout, "current thread: tcr = 0x" LISP ", native thread ID = 0x" LISP ", interrupts %s\n", tcr, tcr->native_thread_id, ilevel);
     158
     159#ifndef WINDOWS
     160    if (lisp_global(BATCH_FLAG)) {
     161      /*
     162       * In batch mode, we will be exiting.  Reset some signal actions
     163       * to the default to avoid a loop of "Unhandled exception 11" or
     164       * whatever if we try to print some call stack that is totally
     165       * screwed up.  (Instead, we'll just die horribly and get it
     166       * over with.)
     167       */
     168      signal(SIGBUS, SIG_DFL);
     169      signal(SIGSEGV, SIG_DFL);
     170    }
     171#endif
     172
    157173    walk_stack_frames((lisp_frame *) ptr_from_lispobj(current_fp), (lisp_frame *) (vs_area->high));
    158174    /*      walk_other_areas();*/
     
    164180plbt(ExceptionInformation *xp)
    165181{
    166 #ifdef X8632
    167   plbt_sp(xpGPR(xp,Iebp));
    168 #else
    169   plbt_sp(xpGPR(xp,Irbp));
    170 #endif
     182  plbt_sp(xpGPR(xp, Ifp));
    171183}
Note: See TracChangeset for help on using the changeset viewer.