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:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=bIUsth6WYXVX+f2rtrm0mNsLxxFniP3Bivro62OkhoKBSra4p/3B+ 0ilVSzlxxh2Irg/6lV98xPT183KfIAZpqhv08YVz3/P9lQOTIst7mXZnaY5Ugmem dzWw1ycOBBg0+hdLEK78uW0d9sXqQJwxd4hl1Uh7/pBZTQmr7i/KoU= 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:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=VKq2wqs++530RTzZ0qiOJxl5HdU=; b=WMkCFo2oyVUfNlurscws5s0gdEu1 NNMK23jdPEX3k3863Nyx5Q61NoL4H8d9JNeIJudbxLd6eKF5j2dy1jlc4Ye2Llze Bc1ORmv36Ct89o0HsUmiZCl0bo5JviQDK2vUbrs1b24YPu15QsR6xJVmJdu5N4Mx ap3n1C/IL2krR7o= 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=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Date: Wed, 21 Oct 2015 12:53:00 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Jemalloc under CYGWIN Message-ID: <20151021105300.GN5319@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Tnj+unmjHTqEM5y0" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) --Tnj+unmjHTqEM5y0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Oct 16 23:56, Yucong Sun wrote: > Hi, >=20 > Throught some frustrating and furious debugging I now understand the > core issue here. CYGWIN calls malloc provided by jemalloc during > initializations, which in turn calls pthreads functions, which in > turn uses malloc, which also uses pthreads, causing a deadlock. >=20 > Now, is there anyway to workaround this issue? Not quickly, at least. I looked into thread.cc and pthread.cc and only found two uses of malloc, one of them should only occur when pthread_exit'ing the main thread, the other in pthread_getattr_np. The first shouldn't matter to jemalloc (or, does it?), the second one I just eliminated. What exactly is the malloc problem you're seeing? In the long run it would be very nice if we could get jemalloc working as the default malloc implementation in Cygwin, replacing dlmalloc. This would allow to get rid of the slow global locking in malloc_wrapper.cc. Historical note: At one point I tried to integrate ptmalloc3, but it always had some unwanted side-effects and fixing them would have been very complicated at the time. So, if you're looking into getting jemalloc into Cygwin, feel free to discuss this further on the cygwin-developers mailing list. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --Tnj+unmjHTqEM5y0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWJ26MAAoJEPU2Bp2uRE+gsasP/A+H9cLo66xCUofnY5UPy3Ne DhIVDsTLjg3fUh73Uq7IHvm47dKio78nN2Qw79knHzu8r5hvS/kfijRQ+Wzyo9dw NZzm9Usle5+hbd0jxA4TBTOdFM3EFGG8Q5MWHq2sqy0XE3/HXB14bY+roApwfiuS MmgzdhkPTqdEA7pzGlf7BdasX1DegCtaai83JRySlQ6hGuGM1HzuhrjARL8oxpye Ka6N21KH6QeBvpa3osISiDcf6dFoOSnEnYsuFTazlyy8dkRb/+E1lgRO+inkONPk I+63h0bVboTHUfhNlxYd9vNsG2Ixn9hyCD2z6q9aVqBcwbDRllDKP6bf+Ban9zRg n0dFePf/C0Y4cEWL3UnuX4RHU5ManJT0dWG8/3E4bCHS0zjV6EjrHtVslLTeaWiy vs/Q+xQYH4SNNzHLQ6EhwmWA9S4xfCXmnWUjly28uUPMP9uHDBmSJ11JfCxNUZDK +0PRdzb0RV7FbKfThqr8mh1MGnd71PIfbgfZgze56IBtA+HaWWoGknQvxWn7DcUv Toff4jA5OM2aACwpGCRUeYLDbsUQjOG3MbQkBahLTM0Fv3Syibxmbm9uBIdLfj11 PK4+3suwEqYw5PPVesEvqUmGeKKJaBjkemvLJf/SAHhFdeImrSCpjNfZFizLg6MP 6p6Zlx9/cRsRtodYywuH =m6bg -----END PGP SIGNATURE----- --Tnj+unmjHTqEM5y0--