Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!caip!cbmvax!vu-vlsi!colin From: colin@vu-vlsi.UUCP (Colin Kelley) Newsgroups: net.unix Subject: catching FPEs? Message-ID: <371@vu-vlsi.UUCP> Date: Wed, 1-Oct-86 12:40:09 EDT Article-I.D.: vu-vlsi.371 Posted: Wed Oct 1 12:40:09 1986 Date-Received: Fri, 3-Oct-86 11:49:15 EDT Organization: Villanova Univ. EE Dept. Lines: 20 I'm using 4.2bsd on a Pyramid. I'm working on a plotting program which allows users to plot arbitrary functions. Sometimes these functions will blow up for one reason or another (usually because their argument is out of range), giving a Floating Point Exception, followed by a core dump. I already trap obvious things like division by zero in my own code, setting a flag to mark the current data point as undefined (so it is not plotted). Now I want to trap FPEs using signal(), having my FPE handler routine set the same flag, then continue. Unfortunately, it seems that when my handler routine returns, the same FPE is occurring again, causing an infinite loop... Is there some way to trap FPEs and then indicate that you want to resume execution _after_ the code which caused the FPE? (setjmp()/longjmp() won't work too well here because I don't just want to return to one place--I want to continue execution wherever it left off.) Or is there a way to modify the argument which was passed into that code so that it will be able to continue without another FPE? Thanks... -Colin Kelley ..{cbmvax,pyrnj,psuvax1}!vu-vlsi!colin