Changeset 11249


Ignore:
Timestamp:
Oct 30, 2008, 1:26:12 PM (11 years ago)
Author:
gb
Message:

Darwin (arriving by way of the Mach exception mechanism) passes
a couple of extra args (the TCR and old valence) into signal_handler().
On other platforms, we don't pass those arguments but have initialized
them in the function. That can only work on platforms that pass
all arguments in registers (or if the compiler keeps the declared
argument's value in a register); if the argument's believed to
be on the stack, initializing it (when nothing was actually pushed ...)
clobbers an arbitrary word on the stack. On x8632 Solaris, this
happened to clobber a "flags" word in the ucontext (which is near
the top of the stack) and kept setcontext() from restoring the
context (because flag bits that specified what parts of the
context should be set were cleared.)

Conditionalize the code instead.

File:
1 edited

Legend:

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

    r11171 r11249  
    12291229
    12301230void
    1231 signal_handler(int signum, siginfo_t *info, ExceptionInformation  *context, TCR *tcr, int old_valence)
     1231signal_handler(int signum, siginfo_t *info, ExceptionInformation  *context
     1232#ifdef DARWIN
     1233               , TCR *tcr, int old_valence
     1234#endif
     1235)
    12321236{
    12331237#ifdef DARWIN_GS_HACK
     
    12361240  xframe_list xframe_link;
    12371241#ifndef DARWIN
    1238   tcr = get_tcr(false);
    1239 
    1240   old_valence = prepare_to_wait_for_exception_lock(tcr, context);
     1242  TCR *tcr = get_tcr(false);
     1243
     1244  int old_valence = prepare_to_wait_for_exception_lock(tcr, context);
    12411245#endif
    12421246  if (tcr->flags & (1<<TCR_FLAG_BIT_PENDING_SUSPEND)) {
Note: See TracChangeset for help on using the changeset viewer.