delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/12/17/05:35:34

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <50CEF551.3010807@mathematik.uni-kl.de>
Date: Mon, 17 Dec 2012 11:34:57 +0100
From: Andreas Steenpass <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: sigpending() crashes
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

A few days ago, I posted a bug report on this mailing list, see

http://cygwin.com/ml/cygwin/2012-12/msg00155.html

There hasn't been any reply to it. Maybe I should have started a new
thread, maybe it was just too much at once, I don't know. But I still
think that this needs to be fixed, so I just post it again. 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