public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Signal delivered while blocked
@ 2017-08-04  7:45 Noah Misch
  2017-08-04 17:02 ` Corinna Vinschen
  2017-08-14  6:03 ` Houder
  0 siblings, 2 replies; 9+ messages in thread
From: Noah Misch @ 2017-08-04  7:45 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 877 bytes --]

The attached demonstration program blocks signals (with sigprocmask()) to
achieve mutual exclusion between signal handlers.  It aborts upon receipt of a
blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64",
signals regularly arrive despite being blocked.  Essential parts of the
program include handling two signal numbers and having handlers run for at
least 1-2ms; this problem goes away if I remove one of those attributes.
GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3) 2013-12-09 11:57
i686" never deliver a blocked signal to this program.  I think this Cygwin
behavior is non-conforming.

PostgreSQL trouble prompted this report; the demonstration program is based on
the "postmaster" architecture.  postmaster SIGCHLD and SIGUSR1 handlers block
most signals, and they cannot cope with interrupts from blocked signals.

Thanks,
nm

[-- Attachment #2: sigprocmask-exclusion.c --]
[-- Type: text/plain, Size: 3190 bytes --]

/*
 * Demonstrate improper delivery of a blocked signal.
 *
 * This program prints "ERROR: already forbidden" and aborts within one
 * second on this configuration (uname -srvm):
 *   CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64
 *
 * It runs indefinitely (>600s) without trouble on these configurations:
 *   CYGWIN_NT-6.0 1.7.27(0.271/5/3) 2013-12-09 11:57 i686
 *   Linux 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 [CentOS 7]
 *   AIX 7100-03-02-1412
 *   SunOS 5.10 Generic_147147-26 sun4u
 */

#include <setjmp.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

static sigset_t block, unblock;
static sig_atomic_t sigblocked = 0;	/* Have I blocked signals? */
static char *stack_base;
static sigjmp_buf jmp;

static void
sigforbid(void)
{
	const char errmsg[] = "ERROR: already forbidden\n";

	if (sigprocmask(SIG_SETMASK, &block, NULL) != 0)
		perror("sigprocmask");

	if (sigblocked == 1)
	{
		write(2, errmsg, sizeof(errmsg) - 1);
		abort();
	}
	sigblocked = 1;
}

static void
sigpermit(void)
{
	const char errmsg[] = "ERROR: already permitted\n";

	if (sigblocked == 0)
	{
		write(2, errmsg, sizeof(errmsg) - 1);
		abort();
	}
	sigblocked = 0;

	if (sigprocmask(SIG_SETMASK, &unblock, NULL) != 0)
		perror("sigprocmask");
}

/*
 * Start fresh in main() when the stack gets too deep.  This is not essential
 * to the test, but it allows for long runs without huge RLIMIT_STACK.
 */
static void
clear_stack_if_needed(void)
{
	char stack_position;
	ptrdiff_t stack_usage;

	stack_usage = stack_base - &stack_position;
	if (stack_usage < 0)
		stack_usage = -stack_usage;
	if (stack_usage > 1024 * 1024)
	{
		puts("releasing excess stack");
		sigblocked = 1;
		siglongjmp(jmp, 1);
	}
}

static void
handler(int arg)
{
	sigforbid();
	clear_stack_if_needed();
	/* wait for extra signal to arrive, after 1-2ms */
	usleep(5000);
	sigpermit();
}

int main(int argc, char **argv)
{
	char stack_position;

	/* initial signal mask setup */
	sigemptyset(&unblock);

	sigfillset(&block);
	sigdelset(&block, SIGTRAP);
	sigdelset(&block, SIGABRT);
	sigdelset(&block, SIGILL);
	sigdelset(&block, SIGFPE);
	sigdelset(&block, SIGSEGV);
	sigdelset(&block, SIGBUS);
	sigdelset(&block, SIGSYS);
	sigdelset(&block, SIGCONT);

	sigforbid();

	/* Register signal handlers.  Problem somehow requires two signals. */
	{
		struct sigaction act, oact;

		act.sa_handler = handler;
		sigemptyset(&act.sa_mask);
		act.sa_flags = 0;
		if (sigaction(SIGUSR1, &act, &oact) != 0)
			perror("sigaction");
		if (sigaction(SIGCHLD, &act, &oact) != 0)
			perror("sigaction");
	}

	/* start a child to inundate me with signals */
	{
		pid_t pid, ppid;
		pid = fork();
		switch (pid)
		{
			case -1:
				perror("fork");
				return 1;
			case 0:
				ppid = getppid();
				printf("pid=%d inundating pid=%d with SIGUSR1 and SIGCHLD\n",
					   getpid(), ppid);
				while (kill(ppid, random() % 2 ? SIGUSR1 : SIGCHLD) == 0)
					;
				puts("child done");
				return 0;
		}
	}

	/* loop forever while we receive signals */
	stack_base = &stack_position;
	sigsetjmp(jmp, 1);
	for (;;)
	{
		sigpermit();
		usleep(1000);
		sigforbid();
	}
}

[-- Attachment #3: cygcheck.out --]
[-- Type: text/plain, Size: 45259 bytes --]


Cygwin Configuration Diagnostics
Current System Time: Fri Aug 04 08:26:04 2017

Windows 2016 Server Datacenter Ver 10.0 Build 14393 

Path:	C:\cygwin64\home\nm\bin
	C:\cygwin64\usr\sbin
	C:\cygwin64\sbin
	C:\cygwin64\usr\local\bin
	C:\cygwin64\bin
	C:\cygwin64\bin
	C:\Tcl\bin
	C:\Perl64\site\bin
	C:\Perl64\bin
	C:\windows\system32
	C:\windows
	C:\windows\System32\Wbem
	C:\windows\System32\WindowsPowerShell\v1.0
	C:\ProgramData\GooGet
	C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin
	C:\Program Files\Compute Engine\sysprep
	C:\Program Files\Google\Compute Engine\sysprep
	C:\Program Files\Google\Compute Engine\metadata_scripts
	C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit
	C:\Strawberry\c\bin
	C:\Strawberry\perl\site\bin
	C:\Strawberry\perl\bin
	C:\Users\cyg_server\AppData\Local\Microsoft\WindowsApps

Output from C:\cygwin64\bin\id.exe
UID: 197608(nm)              GID: 197121(None)
197121(None)                 11(Authenticated Users)
66048(LOCAL)                 66049(CONSOLE LOGON)
4(INTERACTIVE)               15(This Organization)
545(Users)                   544(Administrators)
559(Performance Log Users)   405504(High Mandatory Level)

SysDir: C:\windows\system32
WinDir: C:\windows

USER = 'nm'
PWD = '/home/nm'
HOME = '/home/nm'
DEJAGNU = '/home/nm/.dejagnu/global.exp'
MAKEFLAGS = 's'

USERDOMAIN = 'GUSTNADO'
OS = 'Windows_NT'
PROCESSOR_LEVEL = '6'
PSModulePath = '%ProgramFiles(x86)%\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell'
CommonProgramW6432 = 'C:\Program Files\Common Files'
SSH_CONNECTION = '73.158.248.138 37240 10.128.0.2 22'
CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files'
LANG = 'en_US.UTF-8'
TZ = 'Atlantic/Reykjavik'
CommonProgramFiles = 'C:\Program Files\Common Files'
LESS = '-M -i'
HISTTIMEFORMAT = '%c	'
HOSTNAME = 'gustnado'
PUBLIC = 'C:\Users\Public'
OLDPWD = '/home/nm'
EDITOR = 'emacs -nw'
LOGONSERVER = '\\GUSTNADO'
PROCESSOR_ARCHITECTURE = 'AMD64'
LOCALAPPDATA = 'C:\Users\nm\AppData\Local'
COMPUTERNAME = 'GUSTNADO'
PAGER = 'less'
SYSTEMDRIVE = 'C:'
USERPROFILE = 'C:\Users\nm'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl'
SYSTEMROOT = 'C:\windows'
USERDOMAIN_ROAMINGPROFILE = 'GUSTNADO'
PROCESSOR_IDENTIFIER = 'Intel64 Family 6 Model 63 Stepping 0, GenuineIntel'
TMP = '/tmp'
CLICOLOR = '1'
SSH_CLIENT = '73.158.248.138 37240 22'
GREP_OPTIONS = '--color=auto'
PROCESSOR_REVISION = '3f00'
PROFILEREAD = 'true'
NUMBER_OF_PROCESSORS = '8'
ProgramW6432 = 'C:\Program Files'
SSH_TTY = '/dev/pty0'
MAIL = '/var/spool/mail//nm'
COMSPEC = 'C:\windows\system32\cmd.exe'
GooGetRoot = 'C:\ProgramData\GooGet'
APPDATA = 'C:\Users\nm\AppData\Roaming'
TERM = 'screen-256color'
SHELL = '/bin/bash'
WINDIR = 'C:\windows'
PHYSICAL_TERM = 'screen-256color'
ProgramData = 'C:\ProgramData'
SHLVL = '1'
PRINTER = 'Microsoft Print to PDF'
PROGRAMFILES = 'C:\Program Files'
ALLUSERSPROFILE = 'C:\ProgramData'
TEMP = '/tmp'
LOGNAME = 'nm'
ProgramFiles(x86) = 'C:\Program Files (x86)'
PS1 = '[\u@\h \l:\j \t \W]\$ '
HOMEDRIVE = 'C:'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info'
HOMEPATH = '\cygwin64\home\nm'
HISTSIZE = '200000'
ORIGINAL_PATH = '/bin:/cygdrive/c/Tcl/bin:/cygdrive/c/Perl64/site/bin:/cygdrive/c/Perl64/bin:/cygdrive/c/windows/system32:/cygdrive/c/windows:/cygdrive/c/windows/System32/Wbem:/cygdrive/c/windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/ProgramData/GooGet:/cygdrive/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/cygdrive/c/Program Files/Compute Engine/sysprep:/cygdrive/c/Program Files/Google/Compute Engine/sysprep:/cygdrive/c/Program Files/Google/Compute Engine/metadata_scripts:/cygdrive/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/cygdrive/c/Strawberry/c/bin:/cygdrive/c/Strawberry/perl/site/bin:/cygdrive/c/Strawberry/perl/bin:/cygdrive/c/Users/cyg_server/AppData/Local/Microsoft/WindowsApps'
EXECIGNORE = '*.dll'
CVS_RSH = 'ssh'
LESSOPEN = '|/home/nm/.lesspipe %s'
VS140COMNTOOLS = 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\'
_ = '/usr/bin/cygcheck'

HKEY_CURRENT_USER\SOFTWARE\Cygwin
HKEY_CURRENT_USER\SOFTWARE\Cygwin\Installations
  (default) = '\??\c:\cygwin64'
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\cygwin.com
  (default) = 0x00000002
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
  (default) = '\??\C:\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
  (default) = 'C:\cygwin64'

obcaseinsensitive set to 1

Cygwin installations found in the registry:
  System: Key: e022582115c10879 Path: C:\cygwin64
  User:   Key: e022582115c10879 Path: c:\cygwin64

c:  hd  NTFS     51197Mb  77% CP CS UN PA FC     EN

C:\cygwin64      /          system  binary,auto
C:\cygwin64\bin  /usr/bin   system  binary,auto
C:\cygwin64\lib  /usr/lib   system  binary,auto
cygdrive prefix  /cygdrive  user    binary,posix=0,auto

Found: C:\cygwin64\bin\awk
Found: C:\cygwin64\bin\awk
 -> C:\cygwin64\bin\gawk.exe
Found: C:\cygwin64\bin\bash.exe
Found: C:\cygwin64\bin\bash.exe
Found: C:\cygwin64\bin\cat.exe
Found: C:\cygwin64\bin\cat.exe
Found: C:\cygwin64\bin\cp.exe
Found: C:\cygwin64\bin\cp.exe
Found: C:\cygwin64\bin\cpp.exe
Found: C:\cygwin64\bin\cpp.exe
Not Found: crontab
Found: C:\cygwin64\bin\find.exe
Found: C:\cygwin64\bin\find.exe
Found: C:\windows\system32\find.exe
Warning: C:\cygwin64\bin\find.exe hides C:\windows\system32\find.exe
Found: C:\cygwin64\bin\gcc.exe
Found: C:\cygwin64\bin\gcc.exe
Found: C:\cygwin64\bin\gdb.exe
Found: C:\cygwin64\bin\gdb.exe
Found: C:\cygwin64\bin\grep.exe
Found: C:\cygwin64\bin\grep.exe
Found: C:\cygwin64\bin\kill.exe
Found: C:\cygwin64\bin\kill.exe
Found: C:\cygwin64\bin\ld.exe
Found: C:\cygwin64\bin\ld.exe
Found: C:\cygwin64\bin\ls.exe
Found: C:\cygwin64\bin\ls.exe
Found: C:\cygwin64\bin\make.exe
Found: C:\cygwin64\bin\make.exe
Found: C:\cygwin64\bin\mv.exe
Found: C:\cygwin64\bin\mv.exe
Found: C:\cygwin64\bin\patch.exe
Found: C:\cygwin64\bin\patch.exe
Found: C:\cygwin64\bin\perl.exe
Found: C:\cygwin64\bin\perl.exe
Found: C:\Perl64\bin\perl.exe
Warning: C:\cygwin64\bin\perl.exe hides C:\Perl64\bin\perl.exe
Found: C:\cygwin64\bin\rm.exe
Found: C:\cygwin64\bin\rm.exe
Found: C:\cygwin64\bin\sed.exe
Found: C:\cygwin64\bin\sed.exe
Found: C:\cygwin64\bin\ssh.exe
Found: C:\cygwin64\bin\ssh.exe
Found: C:\cygwin64\bin\sh.exe
Found: C:\cygwin64\bin\sh.exe
Found: C:\cygwin64\bin\tar.exe
Found: C:\cygwin64\bin\tar.exe
Found: C:\cygwin64\bin\test.exe
Found: C:\cygwin64\bin\test.exe
Found: C:\cygwin64\bin\vi.exe
Found: C:\cygwin64\bin\vi.exe
Found: C:\cygwin64\bin\vim.exe
Found: C:\cygwin64\bin\vim.exe

   39k 2016/09/19 C:\cygwin64\bin\cygargp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygargp-0.dll" v0.0 ts=2016-09-19 02:13
   88k 2016/06/13 C:\cygwin64\bin\cygatomic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygatomic-1.dll" v0.0 ts=2016-06-13 17:14
   16k 2013/03/26 C:\cygwin64\bin\cygattr-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygattr-1.dll" v0.0 ts=2013-03-26 18:26
  180k 2015/03/23 C:\cygwin64\bin\cygblkid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygblkid-1.dll" v0.0 ts=2015-03-23 09:46
   64k 2017/02/22 C:\cygwin64\bin\cygbz2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygbz2-1.dll" v0.0 ts=2017-02-22 07:22
   13k 2015/03/19 C:\cygwin64\bin\cygcom_err-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygcom_err-2.dll" v0.0 ts=2015-03-19 02:44
   31k 2013/04/24 C:\cygwin64\bin\cygcord-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygcord-1.dll" v0.0 ts=2013-04-24 23:14
   10k 2016/06/09 C:\cygwin64\bin\cygcrypt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypt-0.dll" v0.0 ts=2016-06-09 16:02
 2235k 2017/01/26 C:\cygwin64\bin\cygcrypto-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypto-1.0.0.dll" v0.0 ts=2017-01-26 20:10
  478k 2016/12/29 C:\cygwin64\bin\cygcurl-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygcurl-4.dll" v0.0 ts=2016-12-29 04:33
 1549k 2016/08/22 C:\cygwin64\bin\cygdb-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb-5.3.dll" v0.0 ts=2016-08-22 09:51
  267k 2016/10/10 C:\cygwin64\bin\cygdbus-1-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdbus-1-3.dll" v0.0 ts=2016-10-10 19:37
  124k 2016/08/22 C:\cygwin64\bin\cygdb_cxx-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb_cxx-5.3.dll" v0.0 ts=2016-08-22 09:52
  570k 2016/08/22 C:\cygwin64\bin\cygdb_sql-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb_sql-5.3.dll" v0.0 ts=2016-08-22 09:52
  154k 2013/10/20 C:\cygwin64\bin\cygedit-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygedit-0.dll" v0.0 ts=2013-10-20 21:56
  145k 2016/06/21 C:\cygwin64\bin\cygexpat-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygexpat-1.dll" v0.0 ts=2016-06-21 23:15
   30k 2014/10/14 C:\cygwin64\bin\cygfam-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygfam-0.dll" v0.0 ts=2014-10-14 21:33
   27k 2015/11/17 C:\cygwin64\bin\cygffi-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygffi-6.dll" v0.0 ts=2015-11-17 22:14
   55k 2017/03/29 C:\cygwin64\bin\cygformw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygformw-10.dll" v0.0 ts=2017-03-29 23:26
  103k 2013/04/24 C:\cygwin64\bin\cyggc-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggc-1.dll" v0.0 ts=2013-04-24 23:14
    8k 2013/04/24 C:\cygwin64\bin\cyggccpp-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggccpp-1.dll" v0.0 ts=2013-04-24 23:14
   70k 2016/06/13 C:\cygwin64\bin\cyggcc_s-seh-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2016-06-13 16:18
   39k 2016/10/10 C:\cygwin64\bin\cyggdbm-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm-4.dll" v0.0 ts=2016-10-10 09:26
   13k 2016/10/10 C:\cygwin64\bin\cyggdbm_compat-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm_compat-4.dll" v0.0 ts=2016-10-10 09:26
 1344k 2017/03/17 C:\cygwin64\bin\cyggio-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggio-2.0-0.dll" v0.0 ts=2017-03-06 06:26
  975k 2017/03/17 C:\cygwin64\bin\cygglib-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygglib-2.0-0.dll" v0.0 ts=2017-03-05 03:42
   15k 2017/03/17 C:\cygwin64\bin\cyggmodule-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmodule-2.0-0.dll" v0.0 ts=2017-03-17 20:26
  527k 2017/01/21 C:\cygwin64\bin\cyggmp-10.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmp-10.dll" v0.0 ts=2017-01-21 18:25
  931k 2015/08/28 C:\cygwin64\bin\cyggnutls-28.dll - os=4.0 img=0.0 sys=5.2
                  "cyggnutls-28.dll" v0.0 ts=2015-08-28 17:05
   24k 2015/08/28 C:\cygwin64\bin\cyggnutls-openssl-27.dll - os=4.0 img=0.0 sys=5.2
                  "cyggnutls-openssl-27.dll" v0.0 ts=2015-08-28 17:06
   41k 2015/08/28 C:\cygwin64\bin\cyggnutlsxx-28.dll - os=4.0 img=0.0 sys=5.2
                  "cyggnutlsxx-28.dll" v0.0 ts=2015-08-28 17:06
  284k 2017/03/17 C:\cygwin64\bin\cyggobject-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggobject-2.0-0.dll" v0.0 ts=2017-03-05 03:42
  105k 2016/06/13 C:\cygwin64\bin\cyggomp-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-1.dll" v0.0 ts=2016-06-13 16:22
   10k 2016/06/13 C:\cygwin64\bin\cyggomp-plugin-host_nonshm-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-plugin-host_nonshm-1.dll" v0.0 ts=2016-06-13 16:23
  258k 2016/09/26 C:\cygwin64\bin\cyggssapi_krb5-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyggssapi_krb5-2.dll" v0.0 ts=2016-09-26 06:55
    9k 2017/03/17 C:\cygwin64\bin\cyggthread-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggthread-2.0-0.dll" v0.0 ts=2017-03-05 03:42
  691k 2013/04/22 C:\cygwin64\bin\cygguile-17.dll - os=4.0 img=0.0 sys=5.2
                  "cygguile-17.dll" v0.0 ts=2013-04-22 03:15
 1311k 2017/04/01 C:\cygwin64\bin\cygguile-2.0-22.dll - os=4.0 img=0.0 sys=5.2
                  "cygguile-2.0-22.dll" v0.0 ts=2017-04-01 04:44
   33k 2017/02/13 C:\cygwin64\bin\cyghistory7.dll - os=4.0 img=0.0 sys=5.2
                  "cyghistory7.dll" v0.0 ts=2017-02-11 22:39
  167k 2016/03/13 C:\cygwin64\bin\cyghogweed-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyghogweed-2.dll" v0.0 ts=2016-03-13 14:46
 1009k 2015/02/20 C:\cygwin64\bin\cygiconv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygiconv-2.dll" v0.0 ts=2015-02-20 17:07
  196k 2014/12/06 C:\cygwin64\bin\cygidn-11.dll - os=4.0 img=0.0 sys=5.2
                  "cygidn-11.dll" v0.0 ts=2014-12-06 13:17
  212k 2016/11/03 C:\cygwin64\bin\cygidn2-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygidn2-0.dll" v0.0 ts=2016-11-03 18:28
   42k 2016/10/23 C:\cygwin64\bin\cygintl-8.dll - os=4.0 img=0.0 sys=5.2
                  "cygintl-8.dll" v0.0 ts=2016-10-23 07:17
 1039k 2015/09/20 C:\cygwin64\bin\cygisl-13.dll - os=4.0 img=0.0 sys=5.2
                  "cygisl-13.dll" v0.0 ts=2015-09-20 12:39
  177k 2016/09/26 C:\cygwin64\bin\cygk5crypto-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygk5crypto-3.dll" v0.0 ts=2016-09-26 06:55
  722k 2016/09/26 C:\cygwin64\bin\cygkrb5-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygkrb5-3.dll" v0.0 ts=2016-09-26 06:55
   35k 2016/09/26 C:\cygwin64\bin\cygkrb5support-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygkrb5support-0.dll" v0.0 ts=2016-09-26 06:54
   45k 2015/11/19 C:\cygwin64\bin\cyglber-2-4-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyglber-2-4-2.dll" v0.0 ts=2015-11-19 14:17
  246k 2015/11/19 C:\cygwin64\bin\cygldap-2-4-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygldap-2-4-2.dll" v0.0 ts=2015-11-19 14:18
  262k 2015/11/19 C:\cygwin64\bin\cygldap_r-2-4-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygldap_r-2-4-2.dll" v0.0 ts=2015-11-19 14:19
    6k 2017/02/12 C:\cygwin64\bin\cyglsa64.dll - os=4.0 img=0.0 sys=5.2
                  "cyglsa64.dll" v0.0 ts=2017-02-12 12:18
   35k 2016/06/28 C:\cygwin64\bin\cygltdl-7.dll - os=4.0 img=0.0 sys=5.2
                  "cygltdl-7.dll" v0.0 ts=2016-06-28 18:41
  139k 2015/11/09 C:\cygwin64\bin\cyglzma-5.dll - os=4.0 img=0.0 sys=5.2
                  "cyglzma-5.dll" v0.0 ts=2015-11-09 06:12
  114k 2016/01/11 C:\cygwin64\bin\cygmagic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygmagic-1.dll" v0.0 ts=2016-01-11 22:19
  169k 2016/10/10 C:\cygwin64\bin\cygman-2-7-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygman-2-7-5.dll" v0.0 ts=2016-10-10 22:07
   22k 2016/10/10 C:\cygwin64\bin\cygmandb-2-7-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygmandb-2-7-5.dll" v0.0 ts=2016-10-10 22:07
   29k 2017/03/29 C:\cygwin64\bin\cygmenuw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygmenuw-10.dll" v0.0 ts=2017-03-29 23:26
   42k 2013/08/12 C:\cygwin64\bin\cygmetalink-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygmetalink-3.dll" v0.0 ts=2013-08-13 00:02
   89k 2015/03/01 C:\cygwin64\bin\cygmpc-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpc-3.dll" v0.0 ts=2015-03-01 20:24
  346k 2016/09/27 C:\cygwin64\bin\cygmpfr-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpfr-4.dll" v0.0 ts=2016-09-27 20:42
   53k 2017/03/29 C:\cygwin64\bin\cygncurses++w-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncurses++w-10.dll" v0.0 ts=2017-03-29 23:31
  282k 2017/03/29 C:\cygwin64\bin\cygncursesw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncursesw-10.dll" v0.0 ts=2017-03-29 23:25
  180k 2016/03/13 C:\cygwin64\bin\cygnettle-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygnettle-4.dll" v0.0 ts=2016-03-13 14:46
  137k 2017/03/13 C:\cygwin64\bin\cygnghttp2-14.dll - os=4.0 img=0.0 sys=5.2
                  "cygnghttp2-14.dll" v0.0 ts=2017-03-13 19:40
  319k 2015/06/01 C:\cygwin64\bin\cygp11-kit-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygp11-kit-0.dll" v0.0 ts=2015-06-01 19:02
   14k 2017/03/29 C:\cygwin64\bin\cygpanelw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygpanelw-10.dll" v0.0 ts=2017-03-29 23:25
  475k 2017/03/05 C:\cygwin64\bin\cygpcre-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpcre-1.dll" v0.0 ts=2017-03-05 03:32
 2020k 2017/01/15 C:\cygwin64\bin\cygperl5_22.dll - os=4.0 img=0.0 sys=5.2
                  "cygperl5_22.dll" v0.0 ts=2017-01-15 12:12
   39k 2015/04/09 C:\cygwin64\bin\cygpipeline-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpipeline-1.dll" v0.0 ts=2015-04-09 21:04
   41k 2016/07/13 C:\cygwin64\bin\cygpopt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpopt-0.dll" v0.0 ts=2016-07-13 06:16
   54k 2016/09/20 C:\cygwin64\bin\cygprocps-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygprocps-5.dll" v0.0 ts=2016-09-20 19:29
   52k 2017/01/17 C:\cygwin64\bin\cygpsl-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygpsl-5.dll" v0.0 ts=2017-01-17 17:10
  308k 2016/06/13 C:\cygwin64\bin\cygquadmath-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygquadmath-0.dll" v0.0 ts=2016-06-13 17:17
  219k 2017/02/13 C:\cygwin64\bin\cygreadline7.dll - os=4.0 img=0.0 sys=5.2
                  "cygreadline7.dll" v0.0 ts=2017-02-11 22:39
   97k 2014/11/24 C:\cygwin64\bin\cygsasl2-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygsasl2-3.dll" v0.0 ts=2014-11-24 18:22
   11k 2015/07/17 C:\cygwin64\bin\cygsigsegv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygsigsegv-2.dll" v0.0 ts=2015-07-17 22:35
   89k 2015/03/23 C:\cygwin64\bin\cygsmartcols-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygsmartcols-1.dll" v0.0 ts=2015-03-23 09:46
  982k 2017/01/09 C:\cygwin64\bin\cygsqlite3-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygsqlite3-0.dll" v0.0 ts=2017-01-09 13:40
  156k 2016/03/02 C:\cygwin64\bin\cygssh2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygssh2-1.dll" v0.0 ts=2016-03-02 18:03
  399k 2017/01/26 C:\cygwin64\bin\cygssl-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssl-1.0.0.dll" v0.0 ts=2017-01-26 20:10
   12k 2016/06/13 C:\cygwin64\bin\cygssp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssp-0.dll" v0.0 ts=2016-06-13 17:10
 1325k 2016/06/13 C:\cygwin64\bin\cygstdc++-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygstdc++-6.dll" v0.0 ts=2016-06-13 16:38
   66k 2016/08/22 C:\cygwin64\bin\cygtasn1-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygtasn1-6.dll" v0.0 ts=2016-08-22 20:11
   53k 2017/03/29 C:\cygwin64\bin\cygticw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygticw-10.dll" v0.0 ts=2017-03-29 23:25
 1538k 2015/10/16 C:\cygwin64\bin\cygunistring-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygunistring-2.dll" v0.0 ts=2015-10-16 21:40
   15k 2015/03/23 C:\cygwin64\bin\cyguuid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyguuid-1.dll" v0.0 ts=2015-03-23 09:46
    8k 2016/06/13 C:\cygwin64\bin\cygvtv-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygvtv-0.dll" v0.0 ts=2016-06-13 17:12
    8k 2016/06/13 C:\cygwin64\bin\cygvtv_stubs-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygvtv_stubs-0.dll" v0.0 ts=2016-06-13 17:12
 1214k 2017/03/13 C:\cygwin64\bin\cygxml2-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygxml2-2.dll" v0.0 ts=2017-03-13 17:01
   83k 2017/03/03 C:\cygwin64\bin\cygz.dll - os=4.0 img=0.0 sys=5.2
                  "cygz.dll" v0.0 ts=2017-03-03 21:42
 3243k 2017/02/12 C:\cygwin64\bin\cygwin1.dll - os=4.0 img=0.0 sys=5.2
                  "cygwin1.dll" v0.0 ts=2017-02-12 12:18
    Cygwin DLL version info:
        DLL version: 2.7.0
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 306
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5

   39k 2016/09/19 C:\cygwin64\bin\cygargp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygargp-0.dll" v0.0 ts=2016-09-19 02:13
   88k 2016/06/13 C:\cygwin64\bin\cygatomic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygatomic-1.dll" v0.0 ts=2016-06-13 17:14
   16k 2013/03/26 C:\cygwin64\bin\cygattr-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygattr-1.dll" v0.0 ts=2013-03-26 18:26
  180k 2015/03/23 C:\cygwin64\bin\cygblkid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygblkid-1.dll" v0.0 ts=2015-03-23 09:46
   64k 2017/02/22 C:\cygwin64\bin\cygbz2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygbz2-1.dll" v0.0 ts=2017-02-22 07:22
   13k 2015/03/19 C:\cygwin64\bin\cygcom_err-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygcom_err-2.dll" v0.0 ts=2015-03-19 02:44
   31k 2013/04/24 C:\cygwin64\bin\cygcord-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygcord-1.dll" v0.0 ts=2013-04-24 23:14
   10k 2016/06/09 C:\cygwin64\bin\cygcrypt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypt-0.dll" v0.0 ts=2016-06-09 16:02
 2235k 2017/01/26 C:\cygwin64\bin\cygcrypto-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypto-1.0.0.dll" v0.0 ts=2017-01-26 20:10
  478k 2016/12/29 C:\cygwin64\bin\cygcurl-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygcurl-4.dll" v0.0 ts=2016-12-29 04:33
 1549k 2016/08/22 C:\cygwin64\bin\cygdb-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb-5.3.dll" v0.0 ts=2016-08-22 09:51
  267k 2016/10/10 C:\cygwin64\bin\cygdbus-1-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdbus-1-3.dll" v0.0 ts=2016-10-10 19:37
  124k 2016/08/22 C:\cygwin64\bin\cygdb_cxx-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb_cxx-5.3.dll" v0.0 ts=2016-08-22 09:52
  570k 2016/08/22 C:\cygwin64\bin\cygdb_sql-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb_sql-5.3.dll" v0.0 ts=2016-08-22 09:52
  154k 2013/10/20 C:\cygwin64\bin\cygedit-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygedit-0.dll" v0.0 ts=2013-10-20 21:56
  145k 2016/06/21 C:\cygwin64\bin\cygexpat-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygexpat-1.dll" v0.0 ts=2016-06-21 23:15
   30k 2014/10/14 C:\cygwin64\bin\cygfam-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygfam-0.dll" v0.0 ts=2014-10-14 21:33
   27k 2015/11/17 C:\cygwin64\bin\cygffi-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygffi-6.dll" v0.0 ts=2015-11-17 22:14
   55k 2017/03/29 C:\cygwin64\bin\cygformw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygformw-10.dll" v0.0 ts=2017-03-29 23:26
  103k 2013/04/24 C:\cygwin64\bin\cyggc-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggc-1.dll" v0.0 ts=2013-04-24 23:14
    8k 2013/04/24 C:\cygwin64\bin\cyggccpp-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggccpp-1.dll" v0.0 ts=2013-04-24 23:14
   70k 2016/06/13 C:\cygwin64\bin\cyggcc_s-seh-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2016-06-13 16:18
   39k 2016/10/10 C:\cygwin64\bin\cyggdbm-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm-4.dll" v0.0 ts=2016-10-10 09:26
   13k 2016/10/10 C:\cygwin64\bin\cyggdbm_compat-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm_compat-4.dll" v0.0 ts=2016-10-10 09:26
 1344k 2017/03/17 C:\cygwin64\bin\cyggio-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggio-2.0-0.dll" v0.0 ts=2017-03-06 06:26
  975k 2017/03/17 C:\cygwin64\bin\cygglib-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygglib-2.0-0.dll" v0.0 ts=2017-03-05 03:42
   15k 2017/03/17 C:\cygwin64\bin\cyggmodule-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmodule-2.0-0.dll" v0.0 ts=2017-03-17 20:26
  527k 2017/01/21 C:\cygwin64\bin\cyggmp-10.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmp-10.dll" v0.0 ts=2017-01-21 18:25
  931k 2015/08/28 C:\cygwin64\bin\cyggnutls-28.dll - os=4.0 img=0.0 sys=5.2
                  "cyggnutls-28.dll" v0.0 ts=2015-08-28 17:05
   24k 2015/08/28 C:\cygwin64\bin\cyggnutls-openssl-27.dll - os=4.0 img=0.0 sys=5.2
                  "cyggnutls-openssl-27.dll" v0.0 ts=2015-08-28 17:06
   41k 2015/08/28 C:\cygwin64\bin\cyggnutlsxx-28.dll - os=4.0 img=0.0 sys=5.2
                  "cyggnutlsxx-28.dll" v0.0 ts=2015-08-28 17:06
  284k 2017/03/17 C:\cygwin64\bin\cyggobject-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggobject-2.0-0.dll" v0.0 ts=2017-03-05 03:42
  105k 2016/06/13 C:\cygwin64\bin\cyggomp-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-1.dll" v0.0 ts=2016-06-13 16:22
   10k 2016/06/13 C:\cygwin64\bin\cyggomp-plugin-host_nonshm-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-plugin-host_nonshm-1.dll" v0.0 ts=2016-06-13 16:23
  258k 2016/09/26 C:\cygwin64\bin\cyggssapi_krb5-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyggssapi_krb5-2.dll" v0.0 ts=2016-09-26 06:55
    9k 2017/03/17 C:\cygwin64\bin\cyggthread-2.0-0.dll - os=4.0 img=0.0 sys=5.2
                  "cyggthread-2.0-0.dll" v0.0 ts=2017-03-05 03:42
  691k 2013/04/22 C:\cygwin64\bin\cygguile-17.dll - os=4.0 img=0.0 sys=5.2
                  "cygguile-17.dll" v0.0 ts=2013-04-22 03:15
 1311k 2017/04/01 C:\cygwin64\bin\cygguile-2.0-22.dll - os=4.0 img=0.0 sys=5.2
                  "cygguile-2.0-22.dll" v0.0 ts=2017-04-01 04:44
   33k 2017/02/13 C:\cygwin64\bin\cyghistory7.dll - os=4.0 img=0.0 sys=5.2
                  "cyghistory7.dll" v0.0 ts=2017-02-11 22:39
  167k 2016/03/13 C:\cygwin64\bin\cyghogweed-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyghogweed-2.dll" v0.0 ts=2016-03-13 14:46
 1009k 2015/02/20 C:\cygwin64\bin\cygiconv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygiconv-2.dll" v0.0 ts=2015-02-20 17:07
  196k 2014/12/06 C:\cygwin64\bin\cygidn-11.dll - os=4.0 img=0.0 sys=5.2
                  "cygidn-11.dll" v0.0 ts=2014-12-06 13:17
  212k 2016/11/03 C:\cygwin64\bin\cygidn2-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygidn2-0.dll" v0.0 ts=2016-11-03 18:28
   42k 2016/10/23 C:\cygwin64\bin\cygintl-8.dll - os=4.0 img=0.0 sys=5.2
                  "cygintl-8.dll" v0.0 ts=2016-10-23 07:17
 1039k 2015/09/20 C:\cygwin64\bin\cygisl-13.dll - os=4.0 img=0.0 sys=5.2
                  "cygisl-13.dll" v0.0 ts=2015-09-20 12:39
  177k 2016/09/26 C:\cygwin64\bin\cygk5crypto-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygk5crypto-3.dll" v0.0 ts=2016-09-26 06:55
  722k 2016/09/26 C:\cygwin64\bin\cygkrb5-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygkrb5-3.dll" v0.0 ts=2016-09-26 06:55
   35k 2016/09/26 C:\cygwin64\bin\cygkrb5support-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygkrb5support-0.dll" v0.0 ts=2016-09-26 06:54
   45k 2015/11/19 C:\cygwin64\bin\cyglber-2-4-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyglber-2-4-2.dll" v0.0 ts=2015-11-19 14:17
  246k 2015/11/19 C:\cygwin64\bin\cygldap-2-4-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygldap-2-4-2.dll" v0.0 ts=2015-11-19 14:18
  262k 2015/11/19 C:\cygwin64\bin\cygldap_r-2-4-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygldap_r-2-4-2.dll" v0.0 ts=2015-11-19 14:19
    6k 2017/02/12 C:\cygwin64\bin\cyglsa64.dll - os=4.0 img=0.0 sys=5.2
                  "cyglsa64.dll" v0.0 ts=2017-02-12 12:18
   35k 2016/06/28 C:\cygwin64\bin\cygltdl-7.dll - os=4.0 img=0.0 sys=5.2
                  "cygltdl-7.dll" v0.0 ts=2016-06-28 18:41
  139k 2015/11/09 C:\cygwin64\bin\cyglzma-5.dll - os=4.0 img=0.0 sys=5.2
                  "cyglzma-5.dll" v0.0 ts=2015-11-09 06:12
  114k 2016/01/11 C:\cygwin64\bin\cygmagic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygmagic-1.dll" v0.0 ts=2016-01-11 22:19
  169k 2016/10/10 C:\cygwin64\bin\cygman-2-7-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygman-2-7-5.dll" v0.0 ts=2016-10-10 22:07
   22k 2016/10/10 C:\cygwin64\bin\cygmandb-2-7-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygmandb-2-7-5.dll" v0.0 ts=2016-10-10 22:07
   29k 2017/03/29 C:\cygwin64\bin\cygmenuw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygmenuw-10.dll" v0.0 ts=2017-03-29 23:26
   42k 2013/08/12 C:\cygwin64\bin\cygmetalink-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygmetalink-3.dll" v0.0 ts=2013-08-13 00:02
   89k 2015/03/01 C:\cygwin64\bin\cygmpc-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpc-3.dll" v0.0 ts=2015-03-01 20:24
  346k 2016/09/27 C:\cygwin64\bin\cygmpfr-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpfr-4.dll" v0.0 ts=2016-09-27 20:42
   53k 2017/03/29 C:\cygwin64\bin\cygncurses++w-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncurses++w-10.dll" v0.0 ts=2017-03-29 23:31
  282k 2017/03/29 C:\cygwin64\bin\cygncursesw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncursesw-10.dll" v0.0 ts=2017-03-29 23:25
  180k 2016/03/13 C:\cygwin64\bin\cygnettle-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygnettle-4.dll" v0.0 ts=2016-03-13 14:46
  137k 2017/03/13 C:\cygwin64\bin\cygnghttp2-14.dll - os=4.0 img=0.0 sys=5.2
                  "cygnghttp2-14.dll" v0.0 ts=2017-03-13 19:40
  319k 2015/06/01 C:\cygwin64\bin\cygp11-kit-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygp11-kit-0.dll" v0.0 ts=2015-06-01 19:02
   14k 2017/03/29 C:\cygwin64\bin\cygpanelw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygpanelw-10.dll" v0.0 ts=2017-03-29 23:25
  475k 2017/03/05 C:\cygwin64\bin\cygpcre-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpcre-1.dll" v0.0 ts=2017-03-05 03:32
 2020k 2017/01/15 C:\cygwin64\bin\cygperl5_22.dll - os=4.0 img=0.0 sys=5.2
                  "cygperl5_22.dll" v0.0 ts=2017-01-15 12:12
   39k 2015/04/09 C:\cygwin64\bin\cygpipeline-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpipeline-1.dll" v0.0 ts=2015-04-09 21:04
   41k 2016/07/13 C:\cygwin64\bin\cygpopt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpopt-0.dll" v0.0 ts=2016-07-13 06:16
   54k 2016/09/20 C:\cygwin64\bin\cygprocps-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygprocps-5.dll" v0.0 ts=2016-09-20 19:29
   52k 2017/01/17 C:\cygwin64\bin\cygpsl-5.dll - os=4.0 img=0.0 sys=5.2
                  "cygpsl-5.dll" v0.0 ts=2017-01-17 17:10
  308k 2016/06/13 C:\cygwin64\bin\cygquadmath-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygquadmath-0.dll" v0.0 ts=2016-06-13 17:17
  219k 2017/02/13 C:\cygwin64\bin\cygreadline7.dll - os=4.0 img=0.0 sys=5.2
                  "cygreadline7.dll" v0.0 ts=2017-02-11 22:39
   97k 2014/11/24 C:\cygwin64\bin\cygsasl2-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygsasl2-3.dll" v0.0 ts=2014-11-24 18:22
   11k 2015/07/17 C:\cygwin64\bin\cygsigsegv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygsigsegv-2.dll" v0.0 ts=2015-07-17 22:35
   89k 2015/03/23 C:\cygwin64\bin\cygsmartcols-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygsmartcols-1.dll" v0.0 ts=2015-03-23 09:46
  982k 2017/01/09 C:\cygwin64\bin\cygsqlite3-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygsqlite3-0.dll" v0.0 ts=2017-01-09 13:40
  156k 2016/03/02 C:\cygwin64\bin\cygssh2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygssh2-1.dll" v0.0 ts=2016-03-02 18:03
  399k 2017/01/26 C:\cygwin64\bin\cygssl-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssl-1.0.0.dll" v0.0 ts=2017-01-26 20:10
   12k 2016/06/13 C:\cygwin64\bin\cygssp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssp-0.dll" v0.0 ts=2016-06-13 17:10
 1325k 2016/06/13 C:\cygwin64\bin\cygstdc++-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygstdc++-6.dll" v0.0 ts=2016-06-13 16:38
   66k 2016/08/22 C:\cygwin64\bin\cygtasn1-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygtasn1-6.dll" v0.0 ts=2016-08-22 20:11
   53k 2017/03/29 C:\cygwin64\bin\cygticw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygticw-10.dll" v0.0 ts=2017-03-29 23:25
 1538k 2015/10/16 C:\cygwin64\bin\cygunistring-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygunistring-2.dll" v0.0 ts=2015-10-16 21:40
   15k 2015/03/23 C:\cygwin64\bin\cyguuid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyguuid-1.dll" v0.0 ts=2015-03-23 09:46
    8k 2016/06/13 C:\cygwin64\bin\cygvtv-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygvtv-0.dll" v0.0 ts=2016-06-13 17:12
    8k 2016/06/13 C:\cygwin64\bin\cygvtv_stubs-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygvtv_stubs-0.dll" v0.0 ts=2016-06-13 17:12
 1214k 2017/03/13 C:\cygwin64\bin\cygxml2-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygxml2-2.dll" v0.0 ts=2017-03-13 17:01
   83k 2017/03/03 C:\cygwin64\bin\cygz.dll - os=4.0 img=0.0 sys=5.2
                  "cygz.dll" v0.0 ts=2017-03-03 21:42
 3243k 2017/02/12 C:\cygwin64\bin\cygwin1.dll - os=4.0 img=0.0 sys=5.2
                  "cygwin1.dll" v0.0 ts=2017-02-12 12:18
    Cygwin DLL version info:
        DLL version: 2.7.0
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 306
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5


Service             : sshd                
Display name        : CYGWIN sshd
Current State       : Running
Controls Accepted   : Stop
Command             : /usr/sbin/sshd -D
stdin path          : /dev/null
stdout path         : /var/log/sshd.log
stderr path         : /var/log/sshd.log
Process Type        : Own Process
Startup             : Automatic
Dependencies        : tcpip
Account             : .\cyg_server


Cygwin Package Information
Last downloaded files to: C:\Users\nm\Downloads
Last downloaded files from: http://mirrors.kernel.org/sourceware/cygwin/

Package                                 Version                Status
_autorebase                             001004-1               OK
alternatives                            1.3.30c-10             OK
base-cygwin                             3.8-1                  OK
base-files                              4.2-4                  OK
bash                                    4.4.12-3               OK
bc                                      1.06.95-2              OK
binutils                                2.25-4                 OK
bison                                   3.0.4-1                OK
bzip2                                   1.0.6-3                OK
ca-certificates                         2.11-1                 OK
coreutils                               8.26-2                 OK
csih                                    0.9.9-1                OK
curl                                    7.52.1-1               OK
cvs                                     1.11.23-2              OK
cygrunsrv                               1.62-1                 OK
cygutils                                1.4.15-2               OK
cygwin                                  2.7.0-1                OK
cygwin-debuginfo                        2.7.0-1                OK
cygwin-devel                            2.7.0-1                OK
dash                                    0.5.9.1-1              OK
desktop-file-utils                      0.23-1                 OK
diffstat                                1.61-1                 OK
diffutils                               3.5-2                  OK
editrights                              1.03-1                 OK
emacs                                   25.2-0.1               OK
file                                    5.25-1                 OK
findutils                               4.6.0-1                OK
flex                                    2.6.3-1                OK
gamin                                   0.1.10-15              OK
gawk                                    4.1.4-3                OK
gcc-core                                5.4.0-1                OK
gdb                                     7.10.1-1               OK
gdb-debuginfo                           7.10.1-1               OK
getent                                  2.18.90-4              OK
git                                     2.8.3-1                OK
grep                                    3.0-2                  OK
groff                                   1.22.3-1               OK
gsettings-desktop-schemas               3.22.0-1               OK
gzip                                    1.8-1                  OK
hostname                                3.13-1                 OK
info                                    6.3-1                  OK
ipc-utils                               1.0-2                  OK
less                                    481-1                  OK
libargp                                 20110921-3             OK
libatomic1                              5.4.0-1                OK
libattr1                                2.4.46-1               OK
libblkid1                               2.25.2-2               OK
libbz2_1                                1.0.6-3                OK
libcom_err2                             1.42.12-2              OK
libcrypt0                               1.4-1                  OK
libcurl4                                7.52.1-1               OK
libdb5.3                                5.3.28-1               OK
libdbus1_3                              1.10.12-1              OK
libedit0                                20130712-1             OK
libexpat1                               2.2.0-0                OK
libfam0                                 0.1.10-15              OK
libffi6                                 3.2.1-2                OK
libgc1                                  7.2d-2                 OK
libgcc1                                 5.4.0-1                OK
libgdbm4                                1.12-1                 OK
libglib2.0_0                            2.50.3-1               OK
libgmp10                                6.1.2-1                OK
libgnutls28                             3.3.17-1               OK
libgomp1                                5.4.0-1                OK
libgssapi_krb5_2                        1.14.4-1               OK
libguile17                              1.8.8-1                OK
libguile2.0_22                          2.0.14-1               OK
libhogweed2                             2.7.1-1                OK
libiconv                                1.14-3                 OK
libiconv2                               1.14-3                 OK
libidn11                                1.29-1                 OK
libidn2_0                               0.11-1                 OK
libintl8                                0.19.8.1-2             OK
libisl13                                0.14.1-1               OK
libk5crypto3                            1.14.4-1               OK
libkrb5_3                               1.14.4-1               OK
libkrb5support0                         1.14.4-1               OK
libltdl7                                2.4.6-4                OK
liblzma5                                5.2.2-1                OK
libmetalink3                            0.1.2-1                OK
libmpc3                                 1.0.3-1                OK
libmpfr4                                3.1.5-1                OK
libncursesw10                           6.0-10.20170325        OK
libnettle4                              2.7.1-1                OK
libnghttp2_14                           1.14.0-2               OK
libopenldap2_4_2                        2.4.42-1               OK
libopenssl100                           1.0.2k-1               OK
libp11-kit0                             0.22.1-1               OK
libpcre1                                8.40-2                 OK
libpipeline1                            1.4.0-1                OK
libpopt-common                          1.16-2                 OK
libpopt0                                1.16-2                 OK
libprocps-ng5                           3.3.11-1               OK
libpsl5                                 0.17.0-1               OK
libquadmath0                            5.4.0-1                OK
libreadline-devel                       7.0.3-3                OK
libreadline7                            7.0.3-3                OK
libsasl2_3                              2.1.26-9               OK
libsigsegv2                             2.10-2                 OK
libsmartcols1                           2.25.2-2               OK
libsqlite3_0                            3.16.2-1               OK
libssh2_1                               1.7.0-1                OK
libssp0                                 5.4.0-1                OK
libstdc++6                              5.4.0-1                OK
libtasn1_6                              4.9-1                  OK
libunistring2                           0.9.6-1                OK
libuuid-devel                           2.25.2-2               OK
libuuid1                                2.25.2-2               OK
libvtv0                                 5.4.0-1                OK
libxml2                                 2.9.4-2                OK
libxml2-debuginfo                       2.9.4-2                OK
libxml2-devel                           2.9.4-2                OK
login                                   1.11-1                 OK
lynx                                    2.8.7-2                OK
m4                                      1.4.18-1               OK
make                                    4.2.1-1                OK
man-db                                  2.7.5-2                OK
mingw64-i686-binutils                   2.25.0.1.23f238d-1     OK
mingw64-i686-gcc-core                   5.4.0-4                OK
mingw64-i686-headers                    5.0.2-1                OK
mingw64-i686-runtime                    5.0.2-1                OK
mingw64-i686-windows-default-manifest   6.4-1                  OK
mingw64-i686-winpthreads                5.0.2-1                OK
mingw64-x86_64-binutils                 2.25.0.1.23f238d-1     OK
mingw64-x86_64-gcc-core                 5.4.0-3                OK
mingw64-x86_64-headers                  5.0.2-1                OK
mingw64-x86_64-runtime                  5.0.2-1                OK
mingw64-x86_64-windows-default-manifest 6.4-1                  OK
mingw64-x86_64-winpthreads              5.0.2-1                OK
mintty                                  2.7.5-0                OK
ncurses                                 6.0-10.20170325        OK
openssh                                 7.5p1-1                OK
openssl                                 1.0.2k-1               OK
openssl-debuginfo                       1.0.2k-1               OK
openssl-devel                           1.0.2k-1               OK
p11-kit                                 0.22.1-1               OK
p11-kit-trust                           0.22.1-1               OK
patch                                   2.7.4-1                OK
perl                                    5.22.3-1               OK
perl-Carp                               1.38-1                 OK
perl-Error                              0.17024-1              OK
perl-TermReadKey                        2.37-1                 OK
perl_autorebase                         5.22.3-1               OK
perl_base                               5.22.3-1               OK
pkg-config                              0.29.1-1               OK
procps-ng                               3.3.11-1               OK
publicsuffix-list-dafsa                 20170206-1             OK
Empty package python
python                                  2.7.13-1               OK
python2                                 2.7.13-1               OK
readline-debuginfo                      7.0.3-3                OK
rebase                                  4.4.2-1                OK
rlwrap                                  0.37-1                 OK
rsync                                   3.1.2-1                OK
run                                     1.3.4-2                OK
screen                                  4.5.1-1                OK
sed                                     4.4-1                  OK
shared-mime-info                        1.7-1                  OK
tar                                     1.29-1                 OK
terminfo                                6.0-10.20170325        OK
terminfo-extra                          6.0-10.20170325        OK
time                                    1.7.2-1                OK
tzcode                                  2016j-1                OK
tzdata                                  2017b-1                OK
util-linux                              2.25.2-2               OK
vim                                     8.0.0525-1             OK
vim-common                              8.0.0525-1             OK
vim-minimal                             8.0.0525-1             OK
w32api-headers                          5.0.2-1                OK
w32api-runtime                          5.0.2-1                OK
wget                                    1.19.1-1               OK
which                                   2.20-2                 OK
windows-default-manifest                6.4-1                  OK
xxd                                     8.0.0525-1             OK
xz                                      5.2.2-1                OK
zip                                     3.0-12                 OK
zlib                                    1.2.11-1               OK
zlib-devel                              1.2.11-1               OK
zlib0                                   1.2.11-1               OK
Use -h to see help about each section


[-- Attachment #4: Type: text/plain, Size: 219 bytes --]


--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-04  7:45 Signal delivered while blocked Noah Misch
@ 2017-08-04 17:02 ` Corinna Vinschen
  2017-08-04 18:58   ` Kaz Kylheku
  2017-08-14  6:03 ` Houder
  1 sibling, 1 reply; 9+ messages in thread
From: Corinna Vinschen @ 2017-08-04 17:02 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

On Aug  4 00:44, Noah Misch wrote:
> The attached demonstration program blocks signals (with sigprocmask()) to
> achieve mutual exclusion between signal handlers.  It aborts upon receipt of a
> blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64",
> signals regularly arrive despite being blocked.  Essential parts of the
> program include handling two signal numbers and having handlers run for at
> least 1-2ms; this problem goes away if I remove one of those attributes.
> GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3) 2013-12-09 11:57
> i686" never deliver a blocked signal to this program.  I think this Cygwin
> behavior is non-conforming.

Thanks for the testcase.  I debugged this a while today but the problem
is far from trivial, apparently.  Don't hold your breath for a quick
solution.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-04 17:02 ` Corinna Vinschen
@ 2017-08-04 18:58   ` Kaz Kylheku
  2017-08-05  6:40     ` Noah Misch
  0 siblings, 1 reply; 9+ messages in thread
From: Kaz Kylheku @ 2017-08-04 18:58 UTC (permalink / raw)
  To: cygwin

On 04.08.2017 10:02, Corinna Vinschen wrote:
> On Aug  4 00:44, Noah Misch wrote:
>> The attached demonstration program blocks signals (with sigprocmask()) 
>> to
>> achieve mutual exclusion between signal handlers.  It aborts upon 
>> receipt of a
>> blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 
>> x86_64",
>> signals regularly arrive despite being blocked.  Essential parts of 
>> the
>> program include handling two signal numbers and having handlers run 
>> for at
>> least 1-2ms; this problem goes away if I remove one of those 
>> attributes.
>> GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3) 
>> 2013-12-09 11:57
>> i686" never deliver a blocked signal to this program.  I think this 
>> Cygwin
>> behavior is non-conforming.
> 
> Thanks for the testcase.  I debugged this a while today but the problem
> is far from trivial, apparently.  Don't hold your breath for a quick
> solution.

Hi! It seems I haven't grasped at straws in a few weeks, so I'm
eager to tug on some dry turf. What the hay, you know?

The test case depends on accesses to the global variable sigblocked not
to be reordered w.r.t. siggprocmask calls.

It is important that the variable not be set to 1 until after the 
signals are
blocked, and be reset to 0 until after they are unblocked.

Thus, the variable should be declared volatile.

(Even basic ISO C says that variables modified by signal handlers
shall be of type "volatile sig_atomic_t", not just "atomic_t").

Although I would be surprised if this were actually happening, in 
principle
at least, compiler could be too clever and "just know" that the 
sigprocmask
standard library function has no interactions with a user-defined global
variable and so the order of the call with respect to the manipulation
of that variable doesn't matter.

Also, related remarks: for the reason that we can't factor out compiler
behavior, with absolute certainty, it would be good to mention not only
the system versions but also GCC. The compiler differs, obviously,
between Cygwin 1.7 and 2.7; not to mention that the case is reported
against i686 of the one, and x86_74 of the other.

Cheers ...

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-04 18:58   ` Kaz Kylheku
@ 2017-08-05  6:40     ` Noah Misch
  0 siblings, 0 replies; 9+ messages in thread
From: Noah Misch @ 2017-08-05  6:40 UTC (permalink / raw)
  To: Kaz Kylheku; +Cc: cygwin

On Fri, Aug 04, 2017 at 11:58:51AM -0700, Kaz Kylheku wrote:
> On 04.08.2017 10:02, Corinna Vinschen wrote:
> >On Aug  4 00:44, Noah Misch wrote:
> >>The attached demonstration program blocks signals (with sigprocmask())
> >>to
> >>achieve mutual exclusion between signal handlers.  It aborts upon
> >>receipt of a
> >>blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18
> >>x86_64",
> >>signals regularly arrive despite being blocked.  Essential parts of the
> >>program include handling two signal numbers and having handlers run for
> >>at
> >>least 1-2ms; this problem goes away if I remove one of those
> >>attributes.
> >>GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3)
> >>2013-12-09 11:57
> >>i686" never deliver a blocked signal to this program.  I think this
> >>Cygwin
> >>behavior is non-conforming.
> >
> >Thanks for the testcase.  I debugged this a while today but the problem
> >is far from trivial, apparently.  Don't hold your breath for a quick
> >solution.

Understood.  Thanks for studying it.

> The test case depends on accesses to the global variable sigblocked not
> to be reordered w.r.t. siggprocmask calls.
> 
> It is important that the variable not be set to 1 until after the signals
> are
> blocked, and be reset to 0 until after they are unblocked.
> 
> Thus, the variable should be declared volatile.

Agreed, but ...

> Although I would be surprised if this were actually happening

... indeed, that didn't change the result.

> Also, related remarks: for the reason that we can't factor out compiler
> behavior, with absolute certainty, it would be good to mention not only
> the system versions but also GCC. The compiler differs, obviously,
> between Cygwin 1.7 and 2.7; not to mention that the case is reported
> against i686 of the one, and x86_74 of the other.

The Cygwin 2.7 system has gcc-core 5.4.0-1.  The unaffected Cygwin 1.7 system
has gcc-core 4.8.2-2.

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-04  7:45 Signal delivered while blocked Noah Misch
  2017-08-04 17:02 ` Corinna Vinschen
@ 2017-08-14  6:03 ` Houder
  2017-08-14  8:36   ` Signal delivered while blocked (2) Houder
  2017-08-19  8:01   ` Signal delivered while blocked Noah Misch
  1 sibling, 2 replies; 9+ messages in thread
From: Houder @ 2017-08-14  6:03 UTC (permalink / raw)
  To: cygwin

On Fri, 4 Aug 2017 00:44:45, Noah Misch wrote:
> --UugvWAfsgieZRqgk
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> 
> The attached demonstration program blocks signals (with sigprocmask()) to
> achieve mutual exclusion between signal handlers.  It aborts upon receipt of a
> blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64",
> signals regularly arrive despite being blocked.  Essential parts of the
> program include handling two signal numbers and having handlers run for at
> least 1-2ms; this problem goes away if I remove one of those attributes.
> GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3) 2013-12-09 11:57
> i686" never deliver a blocked signal to this program.  I think this Cygwin
> behavior is non-conforming.

Hi Noah,

I do not think that Cygwin is the problem here; your code is the problem
here, I believe.

Please, study, for example, chapters 20 and 21 of LPI (Linux Programming
Interface by Michael Kerrisk).

(20.10 The Signal Mask (Blocking Signal Delivery)
(20.13 Changing Signal Dispositions: sigaction())

You cannot use sigprocmask() like you do; you cannot use SIG_SETMASK as
a parameter in sigprocmask() within the context of a handler.

Cygwin exhibits misbehaviour in case of your code, because it is slower
than Linux; however, the code is also wrong for Linux.

The misbehaviour occurs as result of nested interrupts in case of your
code (yes, nested interrupts are possible with Linux/Unix!).
However your code does not experience nesting under Linux, because, as
I said, Linux is faster than Cygwin.

-----
The simplest way to exclude one signal from another, is to specify the
signal (or signals) in the sa_mask of the sigaction parameter ...

    see sigaction()

-----
However if you desire 'control' during the execution of a handler, you
have to resort to sigprocmask(), and use SIG_BLOCK and SIG_UNBLOCK, in
order to add and remove a specific signal to/from the mask.

    see sigprocmask()

You cannot use SIG_SETMASK in that context.

Regards,

Henri

=====


--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked (2)
  2017-08-14  6:03 ` Houder
@ 2017-08-14  8:36   ` Houder
  2017-08-19  8:01   ` Signal delivered while blocked Noah Misch
  1 sibling, 0 replies; 9+ messages in thread
From: Houder @ 2017-08-14  8:36 UTC (permalink / raw)
  To: cygwin

On 2017-08-14 08:03, Houder wrote:
> On Fri, 4 Aug 2017 00:44:45, Noah Misch wrote:
>> --UugvWAfsgieZRqgk
>> Content-Type: text/plain; charset=us-ascii
>> Content-Disposition: inline
>> 
>> The attached demonstration program blocks signals (with sigprocmask()) 
>> to
>> achieve mutual exclusion between signal handlers.  It aborts upon 
>> receipt of a
>> blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 
>> x86_64",
>> signals regularly arrive despite being blocked.  Essential parts of 
>> the
>> program include handling two signal numbers and having handlers run 
>> for at
>> least 1-2ms; this problem goes away if I remove one of those 
>> attributes.
>> GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3) 
>> 2013-12-09 11:57
>> i686" never deliver a blocked signal to this program.  I think this 
>> Cygwin
>> behavior is non-conforming.
> 
> Hi Noah,
> 
> I do not think that Cygwin is the problem here; your code is the 
> problem
> here, I believe.
[snip]

> You cannot use SIG_SETMASK in that context.

You cannot use SIG_SETMASK in that context in the way you do.

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-14  6:03 ` Houder
  2017-08-14  8:36   ` Signal delivered while blocked (2) Houder
@ 2017-08-19  8:01   ` Noah Misch
  2017-08-20 12:18     ` Houder
  1 sibling, 1 reply; 9+ messages in thread
From: Noah Misch @ 2017-08-19  8:01 UTC (permalink / raw)
  To: Houder; +Cc: cygwin

On Mon, Aug 14, 2017 at 08:03:07AM +0200, Houder wrote:
> On Fri, 4 Aug 2017 00:44:45, Noah Misch wrote:
> > The attached demonstration program blocks signals (with sigprocmask()) to
> > achieve mutual exclusion between signal handlers.  It aborts upon receipt of a
> > blocked signal.  On "CYGWIN_NT-10.0 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64",
> > signals regularly arrive despite being blocked.  Essential parts of the
> > program include handling two signal numbers and having handlers run for at
> > least 1-2ms; this problem goes away if I remove one of those attributes.
> > GNU/Linux, AIX, Solaris, and "CYGWIN_NT-6.0 1.7.27(0.271/5/3) 2013-12-09 11:57
> > i686" never deliver a blocked signal to this program.  I think this Cygwin
> > behavior is non-conforming.

> I do not think that Cygwin is the problem here; your code is the problem
> here, I believe.
> 
> Please, study, for example, chapters 20 and 21 of LPI (Linux Programming
> Interface by Michael Kerrisk).
> 
> (20.10 The Signal Mask (Blocking Signal Delivery)
> (20.13 Changing Signal Dispositions: sigaction())
> 
> You cannot use sigprocmask() like you do; you cannot use SIG_SETMASK as
> a parameter in sigprocmask() within the context of a handler.

What words in those chapters prompted your conclusion?  I see nothing in 20.10
or 20.13 about contextual restrictions on SIG_SETMASK.  Posix mentions no such
restrictions in its sigprocmask() page, and Posix does say:

  The following table defines a set of functions that shall be
  async-signal-safe. Therefore, applications can call them, without restriction,
  from signal-catching functions.
  ...
  sigprocmask()
  -- http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

> Cygwin exhibits misbehaviour in case of your code, because it is slower
> than Linux; however, the code is also wrong for Linux.
> 
> The misbehaviour occurs as result of nested interrupts in case of your
> code (yes, nested interrupts are possible with Linux/Unix!).
> However your code does not experience nesting under Linux, because, as
> I said, Linux is faster than Cygwin.

My code *does* experience signal handler nesting on Linux.  In fact, handlers
nest far more quickly than they do under Cygwin.  However, all its nesting
under Linux takes place outside the sigprocmask()-bounded critical section.
The algorithm that inspired this test case tolerates that nesting, but it does
not tolerate nesting within the critical section.

> The simplest way to exclude one signal from another, is to specify the
> signal (or signals) in the sa_mask of the sigaction parameter ...

That is true.  However, as you discovered in your other thread, it is not an
effective workaround for $SUBJECT.

nm

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-19  8:01   ` Signal delivered while blocked Noah Misch
@ 2017-08-20 12:18     ` Houder
  2017-08-20 16:16       ` Noah Misch
  0 siblings, 1 reply; 9+ messages in thread
From: Houder @ 2017-08-20 12:18 UTC (permalink / raw)
  To: Noah Misch; +Cc: cygwin

On 2017-08-19 10:01, Noah Misch wrote:
> What words in those chapters prompted your conclusion?  I see nothing 
> in 20.10
> or 20.13 about contextual restrictions on SIG_SETMASK.  Posix mentions 
> no such
> restrictions in its sigprocmask() page, and Posix does say:

Noah,

My apologies! My command over the English language is poor. English is 
not
my native tongue, and I have hard time getting my point across in 
English.

I am not a language genius.

Let me try again with regard to the most important thing.

Keep in mind, that I replied to your post after I had executed your code 
on
Linux (and had a hard look at your code).

I was astonished to see the 'run-away' stack on Linux ...

("that cannot be correct", was my thinking)

I should have written in my previous reply:

     "you cannot make use of SIG_SETMASK in sigprocmask() within the 
context
      of a handler", IN THE WAY YOU DO IT"
or
     "in the body of a signal handler, one cannot modify the signal mask 
w/o
      knowing what it was at the beginning"

  1. when a signal handler is entered, the kernel will (usually) have 
added
     the signal number, associated to the handler, to the mask
  2. the execution of a handler may be nested within the execution of 
another

Consequently, one does not know what the signal mask is at the beginning 
of
the critical section in the handler.

That is why you want to save the current signal mask when modifying it 
(at
the start of the critical section).

At the end of the critical section, one should restore the old signal 
mask,
or test it in case one want to revert the signal mask "by hand".

Take a look at listing 20-5 in LPI.

And yes, the above should be present in a text book about U/Linux (and 
yes,
it is not explicitly stated in LPI).

Regards,

Henri

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signal delivered while blocked
  2017-08-20 12:18     ` Houder
@ 2017-08-20 16:16       ` Noah Misch
  0 siblings, 0 replies; 9+ messages in thread
From: Noah Misch @ 2017-08-20 16:16 UTC (permalink / raw)
  To: Houder; +Cc: cygwin

On Sun, Aug 20, 2017 at 02:18:45PM +0200, Houder wrote:
> On 2017-08-19 10:01, Noah Misch wrote:
> >What words in those chapters prompted your conclusion?  I see nothing in
> >20.10 or 20.13 about contextual restrictions on SIG_SETMASK.  Posix
> >mentions no such restrictions in its sigprocmask() page, and Posix does
> >say:

> Keep in mind, that I replied to your post after I had executed your code on
> Linux (and had a hard look at your code).
> 
> I was astonished to see the 'run-away' stack on Linux ...
> 
> ("that cannot be correct", was my thinking)
> 
> I should have written in my previous reply:
> 
>     "you cannot make use of SIG_SETMASK in sigprocmask() within the context
>      of a handler", IN THE WAY YOU DO IT"
> or
>     "in the body of a signal handler, one cannot modify the signal mask w/o
>      knowing what it was at the beginning"
> 
>  1. when a signal handler is entered, the kernel will (usually) have added
>     the signal number, associated to the handler, to the mask
>  2. the execution of a handler may be nested within the execution of another
> 
> Consequently, one does not know what the signal mask is at the beginning of
> the critical section in the handler.
> 
> That is why you want to save the current signal mask when modifying it (at
> the start of the critical section).
> 
> At the end of the critical section, one should restore the old signal mask,
> or test it in case one want to revert the signal mask "by hand".
> 
> Take a look at listing 20-5 in LPI.

If the test program has undefined behavior according to Posix, I want to know
that.  If the test program can cause $SUBJECT according to Posix, I want to
know that.

Following your advice above would not remove undefined behavior or prevent
$SUBJECT.  It would make the signal-using software more maintainable and
reduce the risk of consuming all stack space.  Those are good goals for
authors to pursue, but this thread is about delivery of blocked signals.

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-20 16:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04  7:45 Signal delivered while blocked Noah Misch
2017-08-04 17:02 ` Corinna Vinschen
2017-08-04 18:58   ` Kaz Kylheku
2017-08-05  6:40     ` Noah Misch
2017-08-14  6:03 ` Houder
2017-08-14  8:36   ` Signal delivered while blocked (2) Houder
2017-08-19  8:01   ` Signal delivered while blocked Noah Misch
2017-08-20 12:18     ` Houder
2017-08-20 16:16       ` Noah Misch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).