Subject: Re: signal delivery problem (with pthreads)
From: "Valery A. Frolov" <[email-masked]>
To: [email-masked]
Date: Mon, 30 Aug 2004 13:43:50 +0300

Hello,

On Fri, 27 Aug 2004 20:17:09 -0400, Christopher Faylor wrote:
> Sorry, but if this is really a problem, you're going to have to provide a
> simple test case which reproduces it.  Providing a description of the
> symptoms is not going to do it and neither is unsolicited strace output.

Sorry. My fault.

After this my shame I started exploring the cygwin mail list archive.

At first I found out this:
http://sources.redhat.com/ml/cygwin/2004-04/msg00393.html

And after while I've got (IMHO) a little test source (attached) to
reproduce the problem.

$ gcc-2 -Wall -O2 -W -g -o sig_bug.exe sig_bug.c -lpthread
$ gdb sig_bug.exe
(gdb) r
Starting program: /home/Valery/tmp/sig_bug.exe
new thread start
got signal 30
OK, press any key to exit...    <-- there was NO hitting the key
got signal 30
got signal 30                   <-- twice!
select was interrupted 1 times
                                <-- NO "new thread exit" message

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 58.0x75]
0x00000001 in ?? ()
(gdb) bt
#0  0x00000001 in ?? ()
#1  0x00401080 in sig_hnd ()
#2  0x00401169 in _blah (arg=0x0) at sig_bug.c:45
#3  0x61084329 in cygwin1!__getreent () from /usr/bin/cygwin1.dll
#4  0x610035c4 in getprogname () from /usr/bin/cygwin1.dll
#5  0x6100357a in getprogname () from /usr/bin/cygwin1.dll

As noted in my previous message, 1.5.10-3 and 20040821 are both affected.
1.5.9-1 is not tested. 1.5.7-1 is not affected.

I'll send an additional data only on request (to not be annoying).

And three more things.

First. On strace from 1.5.10-3 (25 May 2004) the sig_bug.exe is crashed
without any of "got signal 30" messages in the program output to stdio.
On strace from 1.5.7-1 (30 Jan 2004) all OK. (just FYI)

Second. I tested various versions of cygwin1.dll by placing it and
sig_bug.exe in one empty directory and just ran sig_bug.exe. There were
no additional processes in the memory that used the cygwin1.dll.
Cygserver.exe was not placed in that directory. The CYGWIN environment
variable was not set.

Third. On 1.5.7-1 the count of "interrupted select" was around 15-30
_thousands_. Is it normal? On 1.5.10-3 and 20040821 always only 1
interruption was shown.

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