From owner-freebsd-hackers Wed Feb 19 9: 3:49 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8E9F37B401 for ; Wed, 19 Feb 2003 09:03:47 -0800 (PST) Received: from smtp-relay.omnis.com (smtp-relay.omnis.com [216.239.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B60B43F85 for ; Wed, 19 Feb 2003 09:03:47 -0800 (PST) (envelope-from wes@softweyr.com) Received: from salty.rapid.stbernard.com (corp-2.ipinc.com [199.245.188.2]) by smtp-relay.omnis.com (Postfix) with ESMTP id A80FE44220; Wed, 19 Feb 2003 08:51:23 -0800 (PST) From: Wes Peters Organization: Softweyr.com To: Vaclav Haisman , Terry Lambert Subject: Re: Raising SIGSEGV in SIGSEGV handler makes FreeBSD loop Date: Wed, 19 Feb 2003 08:51:23 -0800 User-Agent: KMail/1.5 Cc: Vaclav Haisman , References: <20030219134131.T70370-100000@logout.sh.cvut.cz> In-Reply-To: <20030219134131.T70370-100000@logout.sh.cvut.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200302190851.23498.wes@softweyr.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wednesday 19 February 2003 04:43, Vaclav Haisman wrote: > > man 2 abort > > > > -- Terry > > logout ~/tmp>man 2 abort > No entry for abort in section 2 of the manual Yeah, it's in (3). try _exit(2). > Besides, this doesn't explain anything. I see I haven't asked any > question in my previous post. So, why does FreeBSD behave different? Because it *is* different? If you want to catch a signal and be able to handle it, the other two are wrong, are they not? The idea here is to catch SEGV and be able to respond to it in some reasonable fashion. What that reasonable fashion might be is left up to the program, that's why we have signal handlers. You might for instance want to close open files or disconnect from a database connection. What if the file close or database socket close yeilds another SEGV? Do you want to just abruptly die, or do you want to at least be able to attempt to log this condition? You can always count the number of SEGVs you've handled with a static counter and modify your behavior accordingly. What would you like to see, a sigaction flag of SA_CRASHON2NDSIG that is set by default? (Ah, Wes, that software comedian.) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message