Path: utzoo!attcan!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: trap causes longjmp botch Keywords: command line argument, Cshell, trap, longjmp Message-ID: <11933@mimsy.UUCP> Date: 13 Jun 88 07:18:10 GMT References: <497@slb-sdr.UUCP> <534@unh.UUCP> <11820@mimsy.UUCP> <502@philmds.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 Xref: utzoo comp.unix.questions:7540 comp.unix.wizards:9277 In article <502@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes: > Used to [use trap 'action' 0] myself that way too ... until one >day the sh (/bin/sh; the Bourne shell on an Ultrix machine) complained >about a 'longjmp botch'; I don't remember if there was a core dump. Unless it was otherwise disabled (file `core' in current directory unwritable, `limit coredumpsize 0', etc), there was. > What is the problem with this trap? [explanation deleted] The problem is that there is a bug in the 4.2BSD /bin/sh such that `trap 0' outside of a script sometimes causes a longjmp to a stack context that is no longer around. Most likely this bug has been around since V7, but is only caught now that longjmp unwinds the stack and aborts if the frame is gone. The bug does not occur when the trap is inside a script. The bug remains in the 4.3BSD /bin/sh. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris