Signal problem

Marc Lehmann schmorp at schmorp.de
Mon Jan 11 00:55:53 CET 2010


On Sun, Jan 10, 2010 at 09:14:04AM -0800, Tim McClarren <tim at idle-games.com> wrote:
>> Not sure who claimed you are an idiot, but you don't understand  
>> SIGSEGV and
>> how it works.
>
> I think I do, in fact.  I use the same handler for the other "abort"  
> signals.  FPE, BUS, etc.

Then I fail to understand your surprise. Honestly.

>> You can't get it that way - when you handler is called from the event
>> loop, you will have the call stack from the event loop.
>
> Yes, I can't get it if I am called once the event loop is unrolled.  My 
> misreading of the docs was that libev would not just deliver this event 
> immediately instead of attempting to unroll.  That it should try that for 
> signals for which the handler cannot return was the part I found 
> unexpected.

There is no unrolling in any way going on. libev converts asynchronous
signals into synchronous signals. What you wish to do simply cannot be done,
and simply makes no sense.

The reason I keep mentioning that you don't seem to understand the
semantics of SEGV is that you keep saying that it should be done in a
way that absolutely makes no sense. (And yes, sure, you can return from
SIGSEGV handlers, it's just that libev can't do this automatically, I
explained this before).

This is not an issue with libev, or that libev somehow doesn't work as
advertised, this is simply a lack of understanding of signal handling in
general on your part.

What you are saying is basically the same as "but libev should
automatically do blocking I/O in cases where it cannot be done
nonblocking", while ignoring the fact that libev doesn't do I/O for you.

It's a fundamental misunderstanding.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list