delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/15/00:15:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Thu, 15 Apr 2004 00:14:55 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.9-1: socket() appears NOT to be thread-safe
Message-ID: <20040415041455.GA998@coe.bosbc.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <00c901c4220d$47f6eaa0$0200a8c0 AT em DOT noip DOT com> <Pine DOT GSO DOT 4 DOT 58 DOT 0404141157150 DOT 21704 AT thing1-200> <011301c42298$19414da0$0200a8c0 AT em DOT noip DOT com>
Mime-Version: 1.0
In-Reply-To: <011301c42298$19414da0$0200a8c0@em.noip.com>
User-Agent: Mutt/1.4.1i

On Thu, Apr 15, 2004 at 11:16:03AM +0800, Enzo Michelangeli wrote:
>What I can do for the time being is to provide the testcase that Corinna
>asked for (attached below). Here are the results:

I can duplicate the behavior noted here.

I sent Corinna a patch in private email.  I'm not thrilled with it but
it does seem to alleviate the problem.

The problem seems to be that winsock's socket is not multi-thread safe.
That is very hard for me to believe but the strace output seems to
confirm it.

My "fix" was to just move an existing mutex lock earlier in the socket
call.  It makes me wonder, if this is really needed for socket, might it
also needed for other network calls like connect, listen, etc.?

Btw, Brian, I could duplicate this behavior with strace.  My usual trick
for doing this is to use a large buffer size:

  strace -oc:/tmp/strace.out -b1000000 threadsocket.exe n

This makes strace a little faster.  This method showed the failure for
me pretty reliably.
--
Christopher Faylor			spammer? ->	aaaspam AT sourceware DOT org
Cygwin Co-Project Leader				aaaspam AT duffek DOT com
TimeSys, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019