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:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=Uzp9DSPcoSMd7N+6LIBl7AbkTxpIeiB+EsoBH8iiiBwwmKQJ3D1nW I8M0sIT5xXD1d6QRLblPDtS7sqKCBYyQXsJU1EbP1CCQvkmDq7qqjr5PNJ1iQS1s CULQwpWVr/NzxZnwtViuQm+i8PkVApRolmHyMcS9WoAZQjZ8xDr7vs= 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:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=cFbj6b347uS9Flg7pe71wmakF78=; b=f9e0+jN+tiNAJuJJSxiku5L70AZm 5tKlWp2JUMLusI/aYdC5ZzwcKZGk91dlhgs9HVy1f+gGuX/+L3Krf6goRd7bR6Lk 8PwtMbxkEzbKt3/CCgTLaMN/BdAl7KTkYEsk6zziYl/sT7GQfaRTuUCoUqmlb4OG TLZp9RG6YdRyANc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-96.6 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_PBL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=H*i:sk:5717C80, H*MI:sk:5717C80, H*f:sk:5717C80, Best X-HELO: calimero.vinschen.de Date: Thu, 21 Apr 2016 09:49:17 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Cc: "Canham, Timothy K (348C)" Subject: Re: pthread_attr_init() returning errors Message-ID: <20160421074917.GB18530@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, "Canham, Timothy K (348C)" References: <20160420105016 DOT GB26118 AT calimero DOT vinschen DOT de> <20160420144013 DOT GC25668 AT calimero DOT vinschen DOT de> <5717C800 DOT 4080009 AT raelity DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XOIedfhf+7KOe/yw" Content-Disposition: inline In-Reply-To: <5717C800.4080009@raelity.com> User-Agent: Mutt/1.5.24 (2015-08-30) --XOIedfhf+7KOe/yw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Apr 20 11:18, Ernie Rael wrote: > On 4/20/2016 10:22 AM, Canham, Timothy K (348C) wrote: > >I think I understand what happened now. The call to pthread_attr_init() = is contained within a function we use to start threads. It is called succes= sive times and it fails on the second call. It would appear that the stack = entry gets laid out the exact same way as the previous call, so pthread_att= r_init() sees the previous pthread_attr_t. I added a memset() of att and th= e issue went away. It looks like that is a good practice anyway. >=20 > Best practice might be using pthread_attr_destroy(attr). Good point. Not calling pthread_attr_destroy on abandoned pthread_attr_t also results in memory leaks on Cygwin. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --XOIedfhf+7KOe/yw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXGIX9AAoJEPU2Bp2uRE+gc40P/3JhgQ5A4W6duE0hOk0xXVc1 OjtZxS61QuaR+nfcO4vB/37VG0xmAXze2SJl3m00wq3prDtYyc09ErmW+KqZWdSP 4Ba/dA5tTUco/Tz+B3kyJl6oWvZdZf+wfUNy9wYY+lV3alS5no9/CVDDmyAch506 ++D+IHuXfCq+iK9uQzCU5cPsSbMUIuyMqAhn05fb3Fq7cokV+nAZX2YaDYLZwJ/8 JrPJxJnav4/dQawBIMSgWyfV1UAy8qSIXxkCCmg0M//tizGPLWtJUxA9hoOuubnF s7/upohoXDWs7XLhd/2WsQ8T7tLeZr2I+CDUlqtdMFUydpS9gdt5CBTC6cGhatpw 9oPaUIh5sgSZTwPnVMOlSLy9owKD/ThPRsaT8NSfSWjh0HwntC9QFzvEB0rcxxKG P0YSN6sVAdaYeq1c6g/2tj2cos7eeDXc1bBeCo70bJxhd0kZSamJczS4MTHrcqOB byfrfSu7nhU8IA7gHMMNyxSHsA/JQWFyaG/l6agVinX8mscygX+eARlhZpv7Yhq2 bJvpU+FusHymJLtwUY2aDCht1QeCSub6QzvkjZRt3g1JcNVgDfo58eMPBmsco/XN S6sjEXOZ4HDxt4Cr2Ybw3V82yPt1CojRpNs6xkjqf65bmfixfoIukI12f8pv0CsD Tsx9BiGYQqr+ZExEJROy =1gsS -----END PGP SIGNATURE----- --XOIedfhf+7KOe/yw--