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

Re: can only interrupt once



+ Noah Friedman <friedman@splode.com>:

| Has anyone else noticed this behavior?
| 
| On linux (redhat 6.1), if I start es, I can hit C-c once to interrupt a
| process started by es.  Afterward, sigint is forever ignored.

Hmmm...  Sounds familiar.  In fact, I saw that problem back in 1996
(but not on linux I think).  Could it be that configure doesn't
correctly set HAVE_SIGSETJMP?  (See stdenv.h).

I never understood the problem then, but managed to expose it enough
that someone who did understand could fix it.  In my case, I think the
interrupt wasn't ignored, but rather masked (with sigsetmask).  I
wrote the following tiny little program to diagnose the problem:

#include <stdlib.h>
#include <stdio.h>
#include <signal.h>

void
main() {
  sigset_t oset;
  if (sigprocmask(SIG_UNBLOCK, NULL, &oset)) perror("sigprocmask");
  else printf("sigprocmask={%08x,%08x,%08x,%08x}\n",
	      oset.__sigbits[0],
	      oset.__sigbits[1],
	      oset.__sigbits[2],
	      oset.__sigbits[3]);
}

Running this from your signal-less shell might tell you whether or not
signals are blocked.  (Warning:  I have no idea how portable the
program is.  I think I wrote it on a sunos4 machine.)

Interesting you should write just now, BTW.  I had been thinking about
the es list, wondering if it still worked and if anybody actually uses
es.  Obviously someone does.  I use it as my login shell still, and
have found no reason to switch.  I've made sure it's available
everywhere at my home university, and a number of people have looked
at it and played with it, but still as far as I know I am the only
regular user.

- Harald