From octave-maintainers-request at bevo dot che dot wisc dot edu Tue Nov 19 14:35:48 1996 Subject: endlos loop with segmentation fault From: "John W. Eaton" To: Friedrich Leisch Cc: Andreas dot Weingessel at ci dot tuwien dot ac dot at, Kurt.Hornik@ci.tuwien.ac.at, octave-maintainers@bevo.che.wisc.edu Date: Tue, 19 Nov 1996 14:34:06 -0600 On 19-Nov-1996, Friedrich Leisch 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 #endif + #include #include + #include #include *************** *** 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