lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Robert Virding once stated:
> 
> > From: "Sean Conner" <sean@conman.org>
> > 
> >   At one point, a daemon I wrote [1] would catch SIGSEGV, log the condition,
> > save its current state and exit.  And yes, it did just that.  Then I
> > realized: if the program generated a SIGSEGV, it was most likely due to a
> > programming error leading to subtle memory corruption and thus, the state
> > I'm saving out could potentially be bogus (garbage in, garbage out).  Better
> > to just log the condition and exit and skip saving any data.  Even
> > better---don't bother with catching the SIGSEGV.  Instead, have a parent
> > process wait for the child to exit, and report the SIGSEGV that way [2].
> 
> Interesting. This is the standard way in which errors are handled in
> Erlang: crash the process and let someone else (another process) catch it
> and clean up after it. It works.

  Yes, that's where I got the concept from---Erlang.

  -spc (Played a bit with Erlang; nice language except the string processing
	is even worse than C's string processing ... )