Re: [AD] mzscheme bindings in svn

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]




Peter Wang wrote:
On 2007-04-28, Jon Rafkind <workmin@xxxxxxxxxx> wrote:
Oh wait I forgot. I did change one fundamental thing about Allegro. In src/x/xsystem.c I had to comment out the signal stuff because mzscheme uses signals for write-barriers with the garbage collector:

static int _xwin_sysdrv_init(void)
{
   char tmp[256];

   _unix_read_os_type();
   /*
   old_sig_abrt = signal(SIGABRT, _xwin_signal_handler);
   old_sig_fpe  = signal(SIGFPE,  _xwin_signal_handler);
   old_sig_ill  = signal(SIGILL,  _xwin_signal_handler);
   old_sig_segv = signal(SIGSEGV, _xwin_signal_handler);
   old_sig_term = signal(SIGTERM, _xwin_signal_handler);
   old_sig_int  = signal(SIGINT,  _xwin_signal_handler);

#ifdef SIGQUIT
   old_sig_quit = signal(SIGQUIT, _xwin_signal_handler);
#endif
*/

Maybe we can wrap those with a
if ( global_use_signals ){
  ...
}
or something?

That would be fine (but call it __al_xwin_dont_install_signal_handlers
or something).  A dirtier solution would be to save the MzScheme signal
handlers before calling allegro_init(), then restore them immediately
afterwards.  This would work with current and older versions of Allegro.

I think messing with the invariants about the garbage collector is tricky business and might lead to very strange results. I'd rather use the _al_xwin_install_signal_handlers way.
OTOH, which signals are MzScheme using?  Surely not SIGABRT, SIGSEGV,
SIGTERM, SIGQUIT?

I think it just uses SIGSEGV and SIGBUS.

GC_old_bus_handler = signal(SIGBUS, GC_write_fault_handler);
GC_old_segv_handler = signal(SIGSEGV, (SIG_PF)GC_write_fault_handler);

Those are the only signals I see it setting with signal().





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/