Eric Schwartz <emschwar / pobox.com> writes:
> I'll see if it works.  I'm currently surprised by the fact that
> somehow the SIGALRM I'm sending to the main process isn't apparently
> being received.  I'm currently building an instrumented Ruby
> interpreter to validate that it's not Ruby's fault.

Okay, it's Ruby's fault.  Or, more probably, my fault for how I am
extending Ruby.

I instrumented signal.c, and what I've found is that sighandler() is
being called for the SIGALRM.  In it, rb_trap_immediate is NOT set, so
rb_trap_pending is incremented, and the SIGALRM entry in trap_pending
list is incremented.  So far so good-- it appears this is Ruby's way
of deferring handling of signals until it's safe to handle them.

The problem is, this signal is never getting handled.  And, well,
kinda the point of a SIGALRM is that it gets sent in a reasonably
timely manner. :) I've noticed this behaviour seems to exist with
every signal, though, except SIGSTOP and SIGKILL (for obvious
reasons).

My code is at
http://sourceforge.net/tracker/?group_id=33142&atid=407383 if anyone
wants to double-check me.  My questions are:

* Is there some way to force Ruby to deliver this signal?  
* How can I tell why it's not being delivered?

Thanks for any help,

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.