delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/07/16:07:22

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=t9B8AHwmOEF0cUS9Na7miTfj1wfkFVrO1uaBdxoTs4/
kMFfd1i8JHTQBF9CfH9r8wOigxcJMqK+2jUMjqfwjfQFTUoJmJxmLxdUXXpMPcCs
9Faw8I0OSrhDlg1jandQPCfi95bPbjVtS5Q6ByJQw3XUuzbkbsV8XRRVdrgrfGao
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=xL068x5Y7XdkTdm8/6AYLrlANBE=; b=QzKofbCC0GwfDLsOQ
vhY4AyG8EW91yrj8ygU/Nd0yWuEI1H4o+sP69HysEwVQ2fUDAhhLR+mNV331KqEq
y2wlgujTZk0IO2pGkQZF76FNODyFxCYZPBgiAKrwANYn3Y+bKb2232OPovMeO5QW
q3wQBl3bBGR7/7RIZvkrai/gII=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1
X-Trace: 866064692/mk-filter-2.mail.uk.tiscali.com/B2C/$THROTTLED_DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/85.210.70.52/None/drstacey AT tiscali DOT co DOT uk
X-SBRS: None
X-RemoteIP: 85.210.70.52
X-IP-MAIL-FROM: drstacey AT tiscali DOT co DOT uk
X-SMTP-AUTH:
X-Originating-Country: GB/UNITED KINGDOM
X-MUA: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6
X-IP-BHB: Once
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AtsBADM8slFV0kY0/2dsb2JhbAANTIM5qw6TYIEXgxcBAQEEOEARCxgJFg8JAwIBAgFFEwgBAbJCkj+PPxaDRgOYaYRjhBCKNg
Message-ID: <51B23D5F.5080304@tiscali.co.uk>
Date: Fri, 07 Jun 2013 21:06:55 +0100
From: David Stacey <drstacey AT tiscali DOT co DOT uk>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: pthread_join() problem
References: <51ABC0BE DOT 5080408 AT tiscali DOT co DOT uk> <20130603100102 DOT GA14318 AT calimero DOT vinschen DOT de> <20130607155812 DOT GA3567 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20130607155812.GA3567@ednor.casa.cgf.cx>

On 07/06/13 16:58, Christopher Faylor wrote:
> On Mon, Jun 03, 2013 at 12:01:02PM +0200, Corinna Vinschen wrote:
>> >On Jun  2 23:01, David Stacey wrote:
>>> >>I'm trying to get Poco[1] working under Cygwin, and have hit a
>>> >>problem with the way it manages its threads. A short example
>>> >>(attached) shows what's going on.
>>> >>
>>> >>Poco creates a global object that is used for managing various
>>> >>threads. In the destructor, the class calls pthread_join() to wait
>>> >>for the threads to finish. This works in Fedora (and presumably
>>> >>other Linux variants), but under Cygwin this call never returns.
>>> >>Note that the object is global, and so pthread_join() is being
>>> >>called after main() has returned and the global variables are being
>>> >>mopped up.
>>> >>
>>> >>In the attached example, the problem only exists if the
>>> >>'thread_container' object is global. When run in this way,
>>> >>pthread_join() never returns and the programme locks up. If
>>> >>'thread_container' is moved local to main() then the programme works
>>> >>correctly. Sadly, I can't make such a trivial fix to the Poco code,
>>> >>which rather relies on this object being global.
>>> >>
>>> >>The attached example (and indeed Poco) runs fine under Fedora 18
>>> >>x64, but locks up on Cygwin (32-bit; haven't tried 64-bit). Problem
>>> >>exists with a vanilla cygwin-1.7.18-1 and the most recent snapshot
>>> >>(2013-06-02).
>> >
>> >Thanks for the simple testcase!
>> >
>> >I tracked this down to a problem in the process exit handling which
>> >disallowed pthreads to exit when process exit was in progress (and
>> >running the global destructors is part of the process exit).  I fixed
>> >that in CVS.
>> >
>> >I'm just uploading a 2013-06-03 snapshot tohttp://cygwin.com/snapshots/
>> >as well as generating a 1.7.9-10 cygwin package for the 64 bit test
>> >distro.  Please give either one of them a try, especially with poco.
> I've reworked this change since Corinna's fix was to what should have
> been obsolete code.  A new snapshot should be uploaded soon.
>
> Could you confirm that things still work as expected?

Thank you for looking at this problem and for providing a new snapshot. 
I have tested the 2013-06-07 snapshot, and can confirm that both my 
testcase and Poco threads function correctly.

Many thanks once again,

Dave.


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

- Raw text -


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