crash protection

Matthias Andree matthias.andree at gmx.de
Sat Sep 6 17:02:59 CEST 2003


David Relson <relson at osagesoftware.com> writes:

> You've persuaded me.  Sounds like crash protection is a bad idea. 
>
> Every one agree?  
>
> Does anyone dissent?  Why?

Yes, I dissent. The code is still useful to prevent DB corruption should
we have opened the DB in write mode.

> If there're no good arguments for keeping the crash protection code,
> I'll delete it in 24 hrs.

Well, we _can_ leave it in place so as to give the data base library
we've linked against a chance of flushing its cache and maintain
consistency, but we should report the error condition.

The path I'd think would be

   if (setjmp(buffer)) {
      close_db();
      fprintf(stderr, "loud complaints with directions where and how to report the error\n");
      exit(3);
   }

We might consider catching SIGTERM ("kill") and SIGINT (Ctrl+C) as well
(through sigsetjmp in that case) so as to prevent DB corruption in these
cases as well.

We just need to make sure that we don't leave to the user the slightest
hint that it might have worked.

-- 
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95




More information about the bogofilter-dev mailing list