Subject: sigfe/pthread bug on Win95 [Was: Re: Also 20040306 snapshot crashes in Win95]
From: "Pierre A. Humblet" <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sun, 21 Mar 2004 09:36:39 -0500

There has been a report of a cygwin crash on Win95

http://www.cygwin.com/ml/cygwin/2004-03/msg00507.html

CYGWIN_95-4.0 erg 1.5.10(0.112/4/2) 2004-03-19 20:04 i586 unknown unknown
Cygwin

Gnuchess is a fairly simple program, so I looked into it.
It uses pthreads and creates a thread that reads the input.
This threads crashes almost immediately.

input.c:  pthread_create(&input_thread, NULL, input_func, NULL);

void *input_func(void *arg __attribute__((unused)) )
{
  char prompt[MAXSTR] = "";

  while (!(flags & QUIT)) {
    if (!(flags & XBOARD)) {
      sprintf(prompt,"%s (%d) : ", 
              RealSide ? "Black" : "White", 
              (RealGameCnt+1)/2 + 1 );
    }

gdb session after break at input_func
*************************************
123       while (!(flags & QUIT)) {
(gdb) n
124         if (!(flags & XBOARD)) {
(gdb) n
125           sprintf(prompt,"%s (%d) : ",
(gdb) stepi
0x00429950 in sprintf ()
(gdb) stepi
0x61091eda in _sigfe_sprintf ()
    at ../../../../src/winsup/cygwin/cygserver.h:82
82        ssize_t error_code () const { return _header.error_code; };
Current language:  auto; currently c++
(gdb) stepi
0x61091edf in _sigfe_sprintf ()
    at ../../../../src/winsup/cygwin/cygserver.h:82
82        ssize_t error_code () const { return _header.error_code; };
(gdb) stepi
0x61090890 in _sigfe () at ../../../../src/winsup/cygwin/cygserver.h:82
82        ssize_t error_code () const { return _header.error_code; };

(gdb) stepi
0x61090891      82        ssize_t error_code () const { return
_header.error_code; };
<snip>

0x610908ca      82        ssize_t error_code () const { return
_header.error_code; };
(gdb) stepi
0x610908ce      82        ssize_t error_code () const { return
_header.error_code; };
(gdb) stepi

Program received signal SIGSEGV, Segmentation fault.
0x610908ce in _sigfe () at ../../../../src/winsup/cygwin/cygserver.h:82
82        ssize_t error_code () const { return _header.error_code; };

(gdb) disas 0x610908ca 0x610908de
Dump of assembler code from 0x610908ca to 0x610908de:
0x610908ca <_sigfe+58>: xchg   %edx,0xc(%esp,1)
0x610908ce <_sigfe+62>: mov    %edx,(%eax)
0x610908d0 <_sigfe+64>: incl   0xfffffbf4(%ebx)
0x610908d6 <_sigfe+70>: decl   0xfffffbfc(%ebx)
0x610908dc <_sigfe+76>: pop    %edx
0x610908dd <_sigfe+77>: pop    %ebx
End of assembler dump.
(gdb) p $eax
$4 = 0

This is not something I know how to fix.
 
Pierre

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