Changeset 13869


Ignore:
Timestamp:
Jun 22, 2010, 4:24:17 PM (9 years ago)
Author:
gb
Message:

For Windows: as suggested by 'maetbag' on #ccl: suspend_tcr() and
raise_thread_interrupt() need to check for the suspended/interrupted
thread's PC being in the readonly (or managed_static) areas and treat
those cases as "really running lisp code"; this hopefully fixes
ticket:677 and ticket:696.

In pc_luser_restore_windows_context(): if we're at (the first instruction
of) restore_windows_context on Win32, the context is still on the stack
(not yet in %ecx.) Also, if the thread was suspended while in the act of
restoring context, it's also restoring the thread's valence to TCR_STATE_LISP
(unless/until we can return from foreign exceptions.)

File:
1 edited

Legend:

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

    r13455 r13869  
    100100      (!((where < (pc)lisp_global(HEAP_END)) &&
    101101         (where >= (pc)lisp_global(HEAP_START))) &&
     102       (!((where < (pc)(managed_static_area->active)) &&
     103         (where >= (pc)(readonly_area->low)))) &&
    102104       !((where < spentry_end) && (where >= spentry_start)) &&
    103105       !((where < subprims_end) && (where >= subprims_start)) &&
     
    19471949    *pcontext = * (CONTEXT *)(pcontext->Rcx);
    19481950#else
    1949     *pcontext = * (CONTEXT *)(pcontext->Ecx);
     1951    if (where == restore_windows_context_start) {
     1952      *pcontext = * (CONTEXT *)((pcontext->Esp)+4);
     1953    } else {
     1954      *pcontext = * (CONTEXT *)(pcontext->Ecx);
     1955    }
    19501956#endif
    19511957  } else {
     
    19701976  }
    19711977  tcr->pending_exception_context = NULL;
     1978  /* We basically never return from an exception unless we
     1979     were executing lisp code when the exception returned.
     1980     If that ever changes, we need to know what valence
     1981     would have been restored here.*/
     1982  tcr->valence = TCR_STATE_LISP;
    19721983}
    19731984
     
    20162027        if (!((where < (pc)lisp_global(HEAP_END)) &&
    20172028              (where >= (pc)lisp_global(HEAP_START))) &&
     2029            (!((where < (pc)(managed_static_area->active)) &&
     2030              (where >= (pc)(readonly_area->low)))) &&
    20182031            !((where < spentry_end) && (where >= spentry_start)) &&
    20192032            !((where < subprims_end) && (where >= subprims_start)) &&
Note: See TracChangeset for help on using the changeset viewer.