From owner-freebsd-current Tue Mar 11 02:08:35 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id CAA10731 for current-outgoing; Tue, 11 Mar 1997 02:08:35 -0800 (PST) Received: from sovcom.kiae.su (sovcom.kiae.su [193.125.152.1]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id CAA10725 for ; Tue, 11 Mar 1997 02:08:30 -0800 (PST) Received: by sovcom.kiae.su id AA13142 (5.65.kiae-1 ); Tue, 11 Mar 1997 12:47:14 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Tue, 11 Mar 97 12:47:14 +0300 Received: (from ache@localhost) by nagual.ru (8.8.5/8.8.5) id MAA00701; Tue, 11 Mar 1997 12:45:59 +0300 (MSK) Date: Tue, 11 Mar 1997 12:45:56 +0300 (MSK) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= To: Brian Somers Cc: Brian Somers , FreeBSD-current Subject: Re: ppp In-Reply-To: <199703110812.IAA12464@awfulhak.demon.co.uk> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 11 Mar 1997, Brian Somers wrote: > Right, but as I pointed out, just about anything that uses Log* will > call LogFlush() and malloc(), and malloc() isn't necessarily the only > problem - there are almost definitely other recursion suseptable > functions running around too, ones that aren't nice enought to tell us > when they can't handle things. I suggest we put back the pending > stuff in all cases except SIGSEGV (which we don't trap). With the > usage of the "caused" variable in handle_signals fixed (I agree, that > was a pretty terrible mistake), there should not be any other > problems. Few minutes ago I send you message with subject "ppp & signals pending" not seeing this your message... Please don't miss it, here I explain my position mainly about SIGALRM and its pending. To summarize it I can say that I agree with restoring pending for SIGALRM, but some additional measurement must be done before. > Ok, so if I put (a fixed) sig.c back in there, could I ask you to do > some testing ? I was thinking of: > > void handle_signals() { > int sig; > int had; > > had = caused; > if (had) > for (sig=0; sig<__MAXSIG; sig++) > if (had&(1< caused &= ~(1< (*handler[sig])(sig+1); > } > } This way you lost _number_ of signals which may come. Since all signals mapped to single bit in "caused" bitmask, here can be f.e. 10 or more similar signals, but only one time signal handler will be executed. You need to replace "caused" bitmask with "int caused[__MAXSIG];" and count true number of signals come: caused[sig]++ (decrease it when handler was executed: caused[sig]--). BTW, why you use own __MAXSIG when standard NSIG is available from signal.h? -- Andrey A. Chernov http://www.nagual.ru/~ache/