FW: commit -- segfault handler on Unix


Subject: FW: commit -- segfault handler on Unix
From: Bruce Pearson (BruceP@wn.com.au)
Date: Thu Jul 13 2000 - 00:13:45 CDT


Sam,

        You do not need a global variable for this.

        Some time ago I added a static variable to the XAP_App class to do the same
thing.

        To get the current App pointer then call XAP_App::getApp(). This can then
be cast to AP_UnixApp.

        eg. AP_UnixApp *p_app = (AP_UnixApp *)XAP_App::getApp();

Bruce.

> -----Original Message-----
> From: owner-abiword-dev@abisource.com
> [mailto:owner-abiword-dev@abisource.com]On Behalf Of sam th
> Sent: Thursday, 13 July, 2000 01:50
> To: abiword developer list
> Subject: commit -- segfault handler on Unix
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> If you all read the interview with Joaquin, he mentioned that AbiWord
> should never, ever lose user data. We had discussed this earlier on the
> list, and the easiest way to do this is with a segfault handler, code that
> executed anytime the program causes a segmentation fault. We now have
> this. Some notes
>
> 1) In doing this, I added the operator [] to UT_Vector. You can now say
> vec[4], just like an STL vector.
>
> 2) I added a global variable in ap_UnixApp.cpp. This was neccessary, and
> is reccommended by the C++ FAQ. But I just wanted to apologize anyway.
>
> 3) This should be easy to implement on other platforms. I hope Win32
> allows you to do something like this, and I believe that Be and QNX are
> POSIX systems, so they should also support signals of the same type.
>
> 4) The function I used, signal(), is not the POSIX fuction, which is
> sigaction(). Unfortunately, sigaction() is very complex, but I will fix
> this eventually.
>
> 5) Should this catch other signals (SIGTERM, the bus error signal, etc)?
>
> This won't save you if your OS crashes, but if we crash, we back up.
>
>
> sam th
> sam@uchicago.edu
> http://www.abisource.com/~sam/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.1 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE5bViht+kM0Mq9M/wRAlYoAJ92ipvEbCcjirWuo3cMmVllpiLPaACgqQVE
> GcR9sNlTmzh5Kkvk/dd7bkI=
> =CeIu
> -----END PGP SIGNATURE-----
>
>



This archive was generated by hypermail 2b25 : Thu Jul 13 2000 - 00:19:34 CDT