Date: Wed, 30 Jul 2003 09:25:26 +0930 From: Greg 'groggy' Lehey <grog@FreeBSD.org> To: cool46 cool46 <coolunixer@hotmail.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Ignoring SIGSEGV (was: no subject line) Message-ID: <20030729235526.GD45069@wantadilla.lemis.com> In-Reply-To: <Law14-F9XBOlnzGOnXP00011bdf@hotmail.com> References: <Law14-F9XBOlnzGOnXP00011bdf@hotmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030729235526.GD45069>