From: Eric Schwartz Date: 2004-08-26T04:11:29+09:00 Subject: Ruby is eating my signals! I posted this to comp.lang.ruby, but got no replies. Perhaps it's more appropriate here. I've built a Ruby extension for STAF () that is mostly working well. However, sometimes the STAF query goes off into the weeds. I want to set up a timeout that sends a SIGALRM to the main process, but that SIGALRM is not getting propogated to my Ruby program. The interpreter is receiving the signal, but isn't passing it along. 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). Is there something I'm doing wrong in my STAF extension? (You can get source at http://sourceforge.net/tracker/?group_id=33142&atid=407383 if you want to double-check me.) 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 -- Eric Schwartz Hewlett-Packard Company Linux/Open Source Labs (LOSL)