Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2008 11:29:37 +0200
From:      Romain =?iso-8859-1?Q?Tarti=E8re?= <romain@blogreen.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Is it possible to recover from SEGV?
Message-ID:  <20081012092937.GA53444@marvin.blogreen.org>
In-Reply-To: <48F147A5.1040107@rawbw.com>
References:  <48F147A5.1040107@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <romain@blogreen.org>        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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081012092937.GA53444>