This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sigwait() ignores non-thread-specific pending signals


Le 07/12/2012 18:38, Christopher Faylor a écrit :
> This should be fixed in CVS and in the upcoming snapshot.

Thank you.I tested the snapshot, and this works now.

I have three more things (please tell me if I should start new threads
for these):

1) When will the next official version of Cygwin be released? I have
written some code for the computer algebra system Singular
(www.singular.uni-kl.de) which relies on the functionality that you just
fixed. We would like to have this code in our next release.

2) Some part of my code uses sigwaitinfo(), an extra thread, and a timer
signal to emulate sigtimedwait() which is missing under Cygwin. I could
contribute my code in order to have sigtimedwait() natively under
Cygwin. Please tell me if you are interested.

3) I noticed another bug related to signals which still remains in the
newest snapshot. Here is a test case:

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

int main()
{
  int signr;
  sigset_t sigusr1, sigusr2, pending;
  sigemptyset(&sigusr1);
  sigemptyset(&sigusr2);
  sigemptyset(&pending);
  sigaddset(&sigusr1, SIGUSR1);
  sigaddset(&sigusr2, SIGUSR2);
  sigprocmask(SIG_BLOCK, &sigusr1, NULL);
  sigprocmask(SIG_BLOCK, &sigusr2, NULL);

  printf("pid: %d\n", getpid());

  sigwait(&sigusr1, &signr);
  sigpending(&pending);
  sigwait(&sigusr2, &signr);

  return(0);
}
####################

$ uname -a
CYGWIN_NT-6.1-WOW64 zoppo 1.7.18s(0.263/5/3) 20121207 21:00:18 i686 Cygwin
$ ./test_case
pid: 2640

// In another console, type(in this order!)
$ kill -SIGUSR2 2640
$ kill -SIGUSR1 2640

// Then the program gives:
Segmentation fault (core dumped)
$

The program doesn't crash if I send SIGUSR1 first and then SIGUSR2.

Regards,
Andreas


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]