delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/17/20:33:12

From: cgf AT bbc DOT com (Chris Faylor)
Subject: Re: Sergey's latest cygwin.dll and pdksh
17 Jun 1997 20:33:12 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <EBxnr8.511.cygnus.gnu-win32@bbc.com>
References: <01BC7B05 DOT DA103740 AT gater DOT krystalbank DOT msk DOT ru>
Reply-To: cgf AT bbc DOT com
X-Newsreader: trn 4.0-test57 (27 Apr 97)
Original-To: gnu-win32 AT cygnus DOT com
X-Mailer: Perl5 Mail::Internet v1.28
Original-Sender: owner-gnu-win32 AT cygnus DOT com

In article <01BC7B05 DOT DA103740 AT gater DOT krystalbank DOT msk DOT ru>,
Sergey Okhapkin  <sos AT prospect DOT com DOT ru> wrote:
>Chris Faylor wrote:
>>
>> #ifdef POSIX_SIGNALS
>>     struct sigaction act;
>>
>>     act.sa_handler = (SIGNAL_HANDTYPE) handler;
>>     sigemptyset(&act.sa_mask);        /* only block sig while in handler 
>*/
>>     act.sa_flags = 0;
>> # ifdef SA_INTERRUPT                  /* SunOS 4.x */
>>     if (interact)
>>         act.sa_flags |= SA_INTERRUPT; /* make sure system calls are not 
>restarte
>> d */
>> # endif
>>     sigaction(sig, &act, (struct sigaction *)NULL);
>>
>> ----
>>
>> Where the 'sig' is 'SIGCHLD'.
>>
>> It appears that 'sig' is blocked while within the handler.  Could that be
>> what is going wrong?
>
>Cygwin.dll blocks the signal while executing signal's handler. If arrived 
>signal is blocked, it will be added to process's sig_pending mask. On exit 
>from any handler all pending signals are raised again. See exceptions.cc 
>for details. Probably, we have to change sig_pending from a bit mask to an 
>array of counters to avoid possible losts of a signals. What do you think 
>about?

That sounds right to me.  Otherwise you lose multiple arrival of signals.

I did take the time to debug this yesterday, and I am mystified as to why
it is failing.  When I set a breakpoint on the signal handler, it is
hit every time a subprocess dies, and 'zsh' continues on as it should.
When I remove the breakpoint zsh 'hangs' waiting for SIGCHLD.  Weird.
-- 
http://www.bbc.com/	cgf AT bbc DOT com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019