From owner-freebsd-questions@FreeBSD.ORG Tue Jul 29 16:55:31 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3579137B401 for ; Tue, 29 Jul 2003 16:55:31 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F50743F3F for ; Tue, 29 Jul 2003 16:55:29 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 14159526B8; Wed, 30 Jul 2003 09:25:26 +0930 (CST) Date: Wed, 30 Jul 2003 09:25:26 +0930 From: Greg 'groggy' Lehey To: cool46 cool46 Message-ID: <20030729235526.GD45069@wantadilla.lemis.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ieONPShpRWd85B+o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: freebsd-questions@FreeBSD.ORG Subject: Ignoring SIGSEGV (was: no subject line) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2003 23:55:31 -0000 --ieONPShpRWd85B+o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 29 July 2003 at 9:16:29 +0000, cool46 cool46 wrote: > how can ignore SEGV signal on Freebsd? You can't. > I am not mean setting SEGV's handler to SIG_IGN,this way can prevent > program to exit,but can't restore environment to continue this > program,so the program will hang and can't exit for ever. Of course. What do you expect to happen? A SIGSEGV is an indication that the instruction being executed can't complete. Ignoring a signal means going back and continuing with that instruction. You'll get the SIGSEGV again. > I see a way in Linux,you can see > http://kaizo.us/mirrors/phrack/phrack58/p58-0x03 , This page returns an error message: Not a typewriter (ENOTTY). > but this is depend on OS because it is closed to OS' underlying > layer and it is not works on Freebsd.Could you give me a > example?thanks. There are two things you can do with a SIGSEGV: 1. Stop it from happening. This is preferable. 2. Add a signal handler which performs some alternative function. For example, you might print out some information about the state of the program before terminating. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply or reply to the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address and phone numbers --ieONPShpRWd85B+o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE/JwltIubykFB6QiMRAoDZAJ9wSFO9xeCrkAUb/9exqkGHa23iiACfd7Og HcPY8QCkNVA/6r4RK2SCanM= =FU9B -----END PGP SIGNATURE----- --ieONPShpRWd85B+o--