Change `abort_to_interpreter' and `exit_interruptable_extent' to
authorChris Hanson <org/chris-hanson/cph>
Sat, 22 Jun 1991 19:29:11 +0000 (19:29 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 22 Jun 1991 19:29:11 +0000 (19:29 +0000)
restore the signal mask.  This should have been done using `sigsetjmp'
and `siglongjmp', but a bug in Sony NEWS OS generates a segmentation
violation when those functions are used this way.  The chosen solution
works, and is slightly more portable.

v7/src/microcode/interp.c
v7/src/microcode/intext.c
v7/src/microcode/uxsig.c
v7/src/microcode/version.h
v8/src/microcode/interp.c
v8/src/microcode/version.h

index 25e1c86768712dbef0d914c967e6b16bb2e8daf7..8a98ac9d98b3cbec7687b15d135522b021b2555d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.61 1991/03/01 00:54:42 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.62 1991/06/22 19:28:54 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -49,6 +49,7 @@ extern PTR EXFUN (obstack_chunk_alloc, (unsigned int size));
 extern void EXFUN (free, (PTR ptr));
 #define obstack_chunk_free free
 extern void EXFUN (back_out_of_primitive_internal, (void));
+extern void EXFUN (preserve_signal_mask, (void));
 \f
 /* In order to make the interpreter tail recursive (i.e.
  * to avoid calling procedures and thus saving unnecessary
@@ -440,6 +441,7 @@ Interpret(dumped_p)
    */
 
   interpreter_catch_dstack_position = dstack_position;
+  preserve_signal_mask ();
   Which_Way = (setjmp (interpreter_catch_env));
   Set_Time_Zone (Zone_Working);
   Import_Registers ();
index 38b7c578b133cac1dddc999faae1767c8083b31a..e4fc9c11f83c495450028cd25ad23b703109801c 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/intext.c,v 1.1 1990/06/20 19:35:50 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/intext.c,v 1.2 1991/06/22 19:29:02 cph Exp $
 
-Copyright (c) 1990 Massachusetts Institute of Technology
+Copyright (c) 1990-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -36,6 +36,8 @@ MIT in each case. */
 #include "dstack.h"
 #include "intext.h"
 
+extern void EXFUN (preserve_signal_mask, (void));
+
 struct interruptable_extent * current_interruptable_extent;
 
 void
@@ -61,6 +63,7 @@ DEFUN_VOID (enter_interruptable_extent)
   /* Create a dynamic binding frame but don't assign the new frame to
      it until the CATCH has been done. */
   dstack_bind ((&current_interruptable_extent), current_interruptable_extent);
+  preserve_signal_mask ();
   return (frame);
 }
 
index 55d848bb2a1d18862fd7a8339741519ce8c22adf..70ca3f64846b1d98787e524008382616edd50af1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.9 1991/06/15 00:40:41 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.10 1991/06/22 19:29:05 cph Exp $
 
 Copyright (c) 1990-91 Massachusetts Institute of Technology
 
@@ -109,6 +109,31 @@ DEFUN (current_handler, (signo), int signo)
 #endif /* HAVE_SYSV3_SIGNALS */
 #endif /* HAVE_POSIX_SIGNALS */
 \f
+#ifdef HAVE_POSIX_SIGNALS
+
+static void
+DEFUN (restore_signal_mask, (environment), PTR environment)
+{
+  UX_sigprocmask (SIG_SETMASK, ((sigset_t *) environment), 0);
+}
+
+void
+DEFUN_VOID (preserve_signal_mask)
+{
+  sigset_t * outside = (dstack_alloc (sizeof (sigset_t)));
+  UX_sigprocmask (SIG_SETMASK, 0, outside);
+  dstack_protect (restore_signal_mask, outside);
+}
+
+#else /* not HAVE_POSIX_SIGNALS */
+
+void
+DEFUN_VOID (preserve_signal_mask)
+{
+}
+
+#endif /* not HAVE_POSIX_SIGNALS */
+\f
 /* Signal Descriptors */
 
 enum dfl_action { dfl_terminate, dfl_ignore, dfl_stop };
index 6bf3bd89daca8701eb85d29a0537d19e6816fc4d..ca6714d6d63c534d88c80ded3dc9cf1146433a83 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.83 1991/06/14 23:36:05 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.84 1991/06/22 19:29:11 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     83
+#define SUBVERSION     84
 #endif
index 4eadb2c9179a8aa7067492606301f4310ff58d9a..ce2f202e6e66518dbf941ee6be2b42cc8d8817e6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.61 1991/03/01 00:54:42 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.62 1991/06/22 19:28:54 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -49,6 +49,7 @@ extern PTR EXFUN (obstack_chunk_alloc, (unsigned int size));
 extern void EXFUN (free, (PTR ptr));
 #define obstack_chunk_free free
 extern void EXFUN (back_out_of_primitive_internal, (void));
+extern void EXFUN (preserve_signal_mask, (void));
 \f
 /* In order to make the interpreter tail recursive (i.e.
  * to avoid calling procedures and thus saving unnecessary
@@ -440,6 +441,7 @@ Interpret(dumped_p)
    */
 
   interpreter_catch_dstack_position = dstack_position;
+  preserve_signal_mask ();
   Which_Way = (setjmp (interpreter_catch_env));
   Set_Time_Zone (Zone_Working);
   Import_Registers ();
index 520e0cd4f3ae38bd89e3da10a23173a83aec1c97..57d348aaa2294dcfd546c2b418bdcc1b47329025 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.83 1991/06/14 23:36:05 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.84 1991/06/22 19:29:11 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     83
+#define SUBVERSION     84
 #endif