From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 12 09:48:11 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7123A106568F for ; Sun, 12 Oct 2008 09:48:11 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from postfix1-g20.free.fr (postfix1-g20.free.fr [212.27.60.42]) by mx1.freebsd.org (Postfix) with ESMTP id ED53A8FC16 for ; Sun, 12 Oct 2008 09:48:10 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by postfix1-g20.free.fr (Postfix) with ESMTP id 2F4722C80381 for ; Sun, 12 Oct 2008 11:29:40 +0200 (CEST) Received: from smtp6-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp6-g19.free.fr (Postfix) with ESMTP id 6CDE5172A5 for ; Sun, 12 Oct 2008 11:29:38 +0200 (CEST) Received: from marvin.blogreen.org (marvin.blogreen.org [82.247.213.140]) by smtp6-g19.free.fr (Postfix) with ESMTP id 50F3017252 for ; Sun, 12 Oct 2008 11:29:38 +0200 (CEST) Received: by marvin.blogreen.org (Postfix, from userid 1001) id B7CDD5E622; Sun, 12 Oct 2008 11:29:37 +0200 (CEST) Date: Sun, 12 Oct 2008 11:29:37 +0200 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: freebsd-hackers@freebsd.org Message-ID: <20081012092937.GA53444@marvin.blogreen.org> Mail-Followup-To: freebsd-hackers@freebsd.org References: <48F147A5.1040107@rawbw.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <48F147A5.1040107@rawbw.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://romain.blogreen.org/pubkey.asc Subject: Re: Is it possible to recover from SEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 09:48:11 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Yuri, On Sat, Oct 11, 2008 at 05:41:09PM -0700, Yuri wrote: > Is there a way to access from signal handler CPU registers as they > were before signal, modify some of them, clear the signal and > continue from the instruction that caused SEGV initially? Maybe you can have a look to the development version of the Enlightenment window manager [1]. It catches segfaults and displayed a window to ask the user what to do (continue, abort). I experienced a few crashes where this helpful window was triggered a dozen times, I asked the window manager to continue and could save my work before everything crashed. First moves in the svn repository [2] (basically grep SEGV): | ./src/bin/e_exec.c:456: else if (cfdata->event.exit_signal =3D=3D SIGSEGV) | ./src/bin/e_desklock.c:689: sigaction(SIGSEGV, &action, NULL); | ./src/bin/e_object.c:153: sigaction(SIGSEGV, &act, &oact); | ./src/bin/e_object.c:158: sigaction(SIGSEGV, &oact, NULL); | ./src/bin/e_object.c:168: sigaction(SIGSEGV, &oact, NULL); | ./src/bin/e_signals.c:28: e_alert_show("This is very bad. Enlightenment= SEGV'd.\n" | ./src/bin/e_signals.c:48: e_alert_show("This is very bad. Enlightenment= SEGV'd.\n" | ./src/bin/e_main.c:99: sigaction(SIGSEGV, &action, NULL); | ./src/bin/e_main.c:322:// FIXME: SEGV's on shutdown if fm2 windows up - d= isable for now. Hope that helps! Romain References: 1. http://enlightenment.org/ 2. http://svn.enlightenment.org/svn/e/trunk/e/ --=20 Romain Tarti=E8re http://romain.blogreen.org/ pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --jI8keyz6grp/JLjh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjxw4EACgkQ2OmjP/9W/0OTsACdGIzyfRR9vWqAO66XUb1eFTxq RYYAn2VQ1tZ5Zy/pZHmRq53MB1TRLr2J =kzze -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--