From owner-freebsd-current Fri Dec 11 16:15:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA19901 for freebsd-current-outgoing; Fri, 11 Dec 1998 16:15:07 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sparky.isocor.com (sparky.isocor.com [198.6.228.217]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA19886 for ; Fri, 11 Dec 1998 16:15:04 -0800 (PST) (envelope-from peter.edwards@isocor.ie) Received: from isocor.ie (198.6.229.204) by sparky.isocor.com (NPlex 4.0.000); Fri, 11 Dec 1998 16:14:54 -0800 Message-ID: <3671B6B6.792BA595@isocor.ie> Date: Fri, 11 Dec 1998 16:20:06 -0800 From: Peter Edwards Organization: ISOCOR X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Archie Cobbs CC: freebsd-current@FreeBSD.ORG Subject: Re: inetd: realloc/free bug References: <199812111957.LAA27876@bubba.whistle.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Archie Cobbs wrote: > > > sigprocmask(SIG_UNBLOCK ..) /* unblock signals */ > > r = select(...) /* wait for event */ > > sigprocmask(SIG_BLOCK ..) /* block signals */ > > > > if (signalFlag || r > 0) { > > ... /* handle event(s) */ > > } > > OK, if you call the signal "event" handler from within the actual > signal handler because of a signal received bewtween lines 1 and 2, > that's OK because you know you're not in a recursive malloc() situation. > So I guess that would work. I think someone else mentioned the problem where the select() timeout can delay processing if the signal arrives inside the race window. That's what I was suggesting getting around with the setjmp/longjmp from signal handler. I know its pretty horrendous, but I just got side-tracked into thinking about what happens normally between the time you return from a signal handler and the synchronous program flow resumes. Can anyone synopsize? Cheers, Peter. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message