Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!hao!hplabs!pesnta!greipa!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: Bourne shell's wacky memory allocation Message-ID: <2969@sun.uucp> Date: Sat, 9-Nov-85 03:16:00 EST Article-I.D.: sun.2969 Posted: Sat Nov 9 03:16:00 1985 Date-Received: Tue, 12-Nov-85 05:09:18 EST References: <482@phri.UUCP> <2887@sun.uucp> <531@moncol.UUCP> Organization: Sun Microsystems, Inc. Lines: 21 > It appears that Guy's fix will make SIGSEGV available for general use > rather than reserved to the shell internals. That would be nice. Don't count your blessings until they've hatched, or something like that. It doesn't make it available for general use, trust me. You also have to catch *all* the places where Bourne uses SIGSEGV to catch attempts to use unallocated portions of the "stack" (temporary string space and the like is allocated on a "stack" which consists mostly of the growing end of the data space, although it's intermixed with blocks from the heap). I got bit by that a couple of days ago, and found *every* place where the "pushstak" macro was used and added a test before it; if the place where the character is to be "pushed" doesn't exist, it grows the data space. I don't claim to have caught every place; I want to beat on it a while, and then build a version of the shell which *does* make SIGSEGV available for "general" use (i.e., the shell will drop core on a SIGSEGV like it's supposed to) and try it for a while. It was a clever idea, my hat's off to Bourne, but I still want to get the vanity plate SIGSEGV for him and weld it to his car, if he's got one. Guy Harris