Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!news From: DBarker@system-m.phx.bull.com ( Deryk Barker) Newsgroups: comp.unix.internals Subject: Re: Unix error handling Message-ID: <24388@adm.BRL.MIL> Date: 4 Sep 90 19:50:36 GMT Sender: news@adm.BRL.MIL Lines: 44 In V10#37 Doug Moen writes: > Here's the obligatory new idea: > I don't like the fact that Unix kills a process if it blows the stack > due to an infinite recursive loop. The problem could be fixed with > the introduction of an exception handling mechanism that the kernel > knows about. If the stack overflows, then the kernel raises an exception > within the offending process. The exception unwinds the stack (thereby > recovering stack space) until a stack frame containing an exception > handler is found. If no exception handler is active, then (and only then) > is the process killed. Ah, what you want is the Multics operating system. The system which inspired Unix in the first place and which most Unix people never mention. The facility you desire exists in Multics, with a further feature: the process is not killed if no handler is found, but is suspended and another level of the command processor is pushed onto the stack. If you can somehow fix the problem which caused the stack overflow (or any other exception) then you can restart the suspended procedure at the faulting instruction. This even works for missing routines when you are using the dyamic linking facility (and you thought OS/2 invented dynamic links!). You can create the missing routine and restart the calling program; makes for a most impressive demo. Unfortunately, Honeywell, who inherited Multics from GE in 1971, capped the product in 1984 and it is no longer sold. There are still some systems in existence (I'm writing this on one now) and I shall miss it very much when it finally goes away. The finest OS every written - bar none. And "David M. Alexander" replies: > You must have been reading about AIXv3 setjmp() and longjmp() recently. > You can use these calls to do exactly that. > AIXv3 is turning out to be a really nice OS. Nice that IBM is finally catching up - some 25 years after the original Multics design work.... Deryk Barker, Jupiter Software, Victoria BC. "Send Lawyers, Guns and Money, Dad, get me out of this!"