Ignore:
Timestamp:
Dec 11, 2008, 1:31:44 PM (11 years ago)
Author:
gb
Message:

Try to use non-conflicting, platform-dependent signals instead of
SIGQUIT. (Darwin uses SIGEMT, which doesn't seem to be raised
by the kernel on x86 or PPC; other platfroms can use user-defined
(possibly "realtime" signals).

Rename kernel things that had 'quit' in their names and had to
do with terminating threads to instead have 'thread_kill' in
their names (e.g. quit_handler -> thread_kill_handler.)

In the x86 GC, at least in mark_root and the recursive case of
rmark, check the dnode against gc_area_dnode before mapping
a TRA to the containing function. (This keeps us from crashing
in those cases if we see a garbage root that's tagged as a TRA,
but that fixes the symptom and not the proble, that would cause
such a garbage root to appear.) This is x86-specific; the
PPC ports don't use TRAs.

Save lisp_heap_gc_threshold, the EGC enable state, and the
sizes of the ephemeral generations in the image and restore
them on startup. (The -T option - which sets the global
GC threshold from the command line - overrides any value
set in the image; more accurately, it does that if the value
of the -T argument isn't the default GC threshold size.)
This is probably the right idea, but it's an incompatible
change; people who override the defaults at build or startup
time may need to change how their systems are built and
initialized.

File:
1 edited

Legend:

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

    r11500 r11501  
    20112011#ifdef WINDOWS
    20122012void
    2013 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    2014 {
    2015 }
    2016 #else
    2017 void
    2018 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     2013thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     2014{
     2015}
     2016#else
     2017void
     2018thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    20192019{
    20202020#ifdef DARWIN_GS_HACK
     
    20362036#ifndef USE_SIGALTSTACK
    20372037void
    2038 arbstack_quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)
     2038arbstack_thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *context)
    20392039{
    20402040#ifdef DARWIN_GS_HACK
     
    20482048      (current_sp < vs->high)) {
    20492049    handle_signal_on_foreign_stack(tcr,
    2050                                    quit_handler,
     2050                                   thread_kill_handler,
    20512051                                   signum,
    20522052                                   info,
     
    20652065    }
    20662066#endif
    2067     quit_handler(signum, info, context);
    2068   }
    2069 }
    2070 
    2071 
    2072 #else
    2073 void
    2074 altstack_quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)
     2067    thread_kill_handler(signum, info, context);
     2068  }
     2069}
     2070
     2071
     2072#else
     2073void
     2074altstack_thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *context)
    20752075{
    20762076#ifdef DARWIN_GS_HACK
     
    20792079  TCR* tcr = get_tcr(true);
    20802080  handle_signal_on_foreign_stack(tcr,
    2081                                  quit_handler,
     2081                                 thread_kill_handler,
    20822082                                 signum,
    20832083                                 info,
     
    20942094#ifdef USE_SIGALTSTACK
    20952095#define SUSPEND_RESUME_HANDLER altstack_suspend_resume_handler
    2096 #define QUIT_HANDLER altstack_quit_handler
     2096#define THREAD_KILL_HANDLER altstack_thread_kill_handler
    20972097#else
    20982098#define SUSPEND_RESUME_HANDLER arbstack_suspend_resume_handler
    2099 #define QUIT_HANDLER arbstack_quit_handler
     2099#define THREAD_KILL_HANDLER arbstack_thread_kill_handler
    21002100#endif
    21012101
     
    21102110{
    21112111  thread_suspend_signal = SIG_SUSPEND_THREAD;
    2112   thread_quit_signal = SIG_KILL_THREAD;
     2112  thread_kill_signal = SIG_KILL_THREAD;
    21132113
    21142114  install_signal_handler(thread_suspend_signal, (void *)SUSPEND_RESUME_HANDLER);
    2115   install_signal_handler(thread_quit_signal, (void *)QUIT_HANDLER);
     2115  install_signal_handler(thread_kill_signal, (void *)THREAD_KILL_HANDLER);
    21162116}
    21172117#endif
Note: See TracChangeset for help on using the changeset viewer.