Ignore:
Timestamp:
Feb 21, 2011, 8:23:44 AM (9 years ago)
Author:
gb
Message:

Handle SIGBUS: if we get a SIGBUS trying to access the page before our
soft guard pages, map the page and let other mechanisms (those guard
pages, the check in rmark()) deal with (pending) overflow. (This is
to work around the problem noted in
http://clozure.com/pipermail/openmcl-devel/2011-January/012498.html,
which seems to be present in new Linux kernels, at least on the ARM.)

File:
1 edited

Legend:

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

    r14549 r14655  
    14861486{
    14871487  TCR *tcr=get_tcr(true);
    1488   if (signo == SIGSEGV) {
     1488 
     1489  if (signo == SIGBUS) {
     1490    BytePtr addr = (BytePtr)(xp->uc_mcontext.fault_address);
     1491    area *a = tcr->cs_area;
     1492    if (((BytePtr)truncate_to_power_of_2(addr,log2_page_size))== a->softlimit)
     1493{
     1494      if (mmap(a->softlimit,
     1495               page_size,
     1496               PROT_READ|PROT_WRITE|PROT_EXEC,
     1497               MAP_PRIVATE|MAP_ANON|MAP_FIXED,
     1498               -1,
     1499               0) == a->softlimit) {
     1500        return;
     1501      }
     1502    }
     1503  } else if (signo == SIGSEGV) {
    14891504    BytePtr addr = (BytePtr)(xp->uc_mcontext.fault_address);
    14901505    area *a = tcr->cs_area;
     
    17991814    install_signal_handler(SIGILL, (void *)sigill_handler, true, false);
    18001815    install_signal_handler(SIGSEGV, (void *)ALTSTACK(signal_handler),true, true);
     1816    install_signal_handler(SIGBUS, (void *)ALTSTACK(signal_handler),true,true);
    18011817
    18021818  }
Note: See TracChangeset for help on using the changeset viewer.