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]

sigpending() crashes


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


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