delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/12/10/08:01:28

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <50C5DD15.3030602@mathematik.uni-kl.de>
Date: Mon, 10 Dec 2012 14:01:09 +0100
From: =?ISO-8859-1?Q?Andreas_Steenpa=DF?= <steenpass AT mathematik DOT uni-kl DOT de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: sigwait() ignores non-thread-specific pending signals
References: <50C09142 DOT 1090904 AT mathematik DOT uni-kl DOT de> <20121207012753 DOT GA10201 AT ednor DOT casa DOT cgf DOT cx> <50C1BAF5 DOT 6000802 AT mathematik DOT uni-kl DOT de> <20121207173840 DOT GA30939 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20121207173840.GA30939@ednor.casa.cgf.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


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