[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
endlos loop with segmentation fault
From: |
John W. Eaton |
Subject: |
endlos loop with segmentation fault |
Date: |
Tue, 19 Nov 1996 14:34:06 -0600 |
On 19-Nov-1996, Friedrich Leisch <address@hidden> wrote:
: it happenend already two times at our department that somebody wanted
: to quit octave and got caught in an infinite loop with octave messages
: "Segmentation fault ... trying to stop myself" rushing over the screen.
Here's a patch that might be able to prevent the endless loop:
Index: sighandlers.cc
===================================================================
RCS file: /home/jwe/src/master/octave/src/sighandlers.cc,v
retrieving revision 1.44
diff -c -r1.44 sighandlers.cc
*** sighandlers.cc 1996/11/14 08:39:47 1.44
--- sighandlers.cc 1996/11/19 20:30:59
***************
*** 24,30 ****
--- 24,32 ----
#include <config.h>
#endif
+ #include <cstdlib>
#include <csignal>
+
#include <new>
#include <iostream.h>
***************
*** 88,98 ****
static void
my_friendly_exit (const char *sig_name, int sig_number)
{
! error ("%s -- stopping myself...", sig_name);
! save_user_variables ();
! clean_up_and_exit (sig_number);
}
// I know, not really a signal handler.
--- 90,117 ----
static void
my_friendly_exit (const char *sig_name, int sig_number)
{
! static bool been_there_done_that = false;
!
! if (been_there_done_that)
! {
! #ifdef SIGABRT
! octave_set_signal_handler (SIGABRT, SIG_DFL);
! #endif
!
! error ("attempted clean up seems to have failed -- aborting...");
!
! abort ();
! }
! else
! {
! been_there_done_that = true;
!
! error ("%s -- stopping myself...", sig_name);
! save_user_variables ();
! clean_up_and_exit (sig_number);
! }
}
// I know, not really a signal handler.
If you happen to find a way to repeat this, I'd definitely like to be
able to fix the problem that is actually causing the segfault.
Thanks,
jwe