Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!hub.ucsb.edu!eiffel!jp From: jp@eiffel.UUCP (Jean-Pierre Sarkis) Newsgroups: comp.lang.eiffel Subject: Re: Catching signals Keywords: Patch for Eiffel 2.2B: rescue clause ignored in package Message-ID: <375@eiffel.UUCP> Date: 23 Jul 90 21:28:10 GMT Organization: Interactive Software Engineering, Santa Barbara CA Lines: 92 Chris Clifton (935@rossignol.Princeton.EDU) wrote: >I am trying to deal with an external signal in a rescue clause. >Basically the code is as follows: > >rescue > if exception = Sighup then > ignore(Sighup); -- One is enough. > signalled := true; > retry > end > >This works fine when compiled with es -d, even with no assertion checking. >However, when I generate a package the rescue clause is ignored: the program >terminates with the following message: > Following information could be incomplete or untrustworthy. > System execution failed. > Below is the sequence of recorded exceptions: > ---------------------------------------------------------------------------- > Object Class Routine Nature of exception Effect > ---------------------------------------------------------------------------- > External event: > Hangup. Fail > ---------------------------------------------------------------------------- > For more information on the last exception, > recompile with option PRECONDITIONS or ALL_ASSERTIONS on. > >Anyone have any suggestions on what this might be and how to fix it? This bug has been fixed in our current development version. The following will patch the run-time in Eiffel 2.2B in order to handle exceptions properly when the system is compiled with no assertion checking and post-processed. PATCH: ----- 1) DO a BACKUP of the directory $INSTALLATION/Eiffel/files 2) Edit the file $INSTALLATION/Eiffel/files/_eiffel.c and modify the C routine rout_conv() as following: ********************** START ********************* static void rout_conv (rout_nm, classnum, routnum) char *rout_nm; int classnum, routnum; { if (routnum<=NO_ROUT) sprintf (rout_nm, "%s", " "); else if (routnum==CREATE_ROUT) sprintf (rout_nm, "%s", "create"); else if (routnum==PUT_ROUT) sprintf (rout_nm, "%s", "put"); else if (routnum==AT_ROUT) sprintf (rout_nm, "%s", "item"); else if (Rout_names [classnum] && Rout_names [classnum][routnum]) sprintf (rout_nm, "%s", Rout_names [classnum] [routnum]); else sprintf (rout_nm, "(NULL)"); } ********************** END ********************************* The modification is on the line "if (Rout_names [classnum] && Rout_names [classnum][routnum])" 3) Save the file and generate the new run_time archive: (Check the CFLAGS in makefile _makeD: -O -DBSD or -O -DSYSTEMV depending on your Unix system) execute: make -f _makeD 4) Recompile your application with the post-processor turned ON. Jean-Pierre SARKIS jp@eiffel.com (Technical support: eiffel@eiffel.com) -- Jean-Pierre SARKIS Interactive Software Engineering Reply-to: eiffel@eiffel.com