From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73194 invoked by alias); 21 Oct 2015 14:15:26 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 72573 invoked by uid 89); 21 Oct 2015 14:15:26 -0000 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-Spam-User: qpsmtpd, 2 recipients X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Oct 2015 14:15:25 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 39D84A803D5; Wed, 21 Oct 2015 16:15:23 +0200 (CEST) Date: Wed, 21 Oct 2015 14:16:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com, cygwin-developers@cygwin.com Subject: Re: Jemalloc under CYGWIN Message-ID: <20151021141523.GV5319@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com, cygwin-developers@cygwin.com References: <20151021105300.GN5319@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LbN0412894TjpI52" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00347.txt.bz2 --LbN0412894TjpI52 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1346 On Oct 21 21:49, Yucong Sun wrote: > > What exactly is the malloc problem you're seeing? >=20 > The specific problem I'm having is that jemalloc's malloc_init() calls > needs to use pthread_mutex_init() or even pthread_mutex with a > initializer. Both in-turn uses malloc, triggering this issue. >=20 > A quick fix would be somehow make pthread always use system > malloc/free, which shouldn't be that bad. What about using a native critical section instead? It shouldn't be too tricky to conditionalize this in jemalloc. > Another issue I saw is that jemalloc will use readlink() for > "/etc/jemalloc.conf" during malloc_init(), which on cygwin, this > function uses "new" to do some path manipulating work, which also have > the same issue. However, we can probably just disable that . Or alternatively the file can be reasd like the other files in /etc Cygwin needs early access to. See the NT_readline class and an example usage in, e.g, mount_info::from_fstab. > So, the quickest fix would be to make cygwin's thread implementations > always use system malloc. >=20 > some small workarounds in jemalloc would be needed afterwards, but it > should be a nice starting point. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --LbN0412894TjpI52 Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWJ537AAoJEPU2Bp2uRE+gBMYP/28Dm4tPXM+zfgKJKL0HyrSD WByrJwhNQL7xoSgFELU0hJ1pyju2VPmctHXIGpQ3VThW0FbHqwT6wsoTwu6PItRO 5wRx9cxLM9/m+dD8zpS1vyXo7/rkEYG1lxlcUVfmYfqPzFtxWCq5gLeMWVEb7NL7 JyKCrNpAZrfjwxi5xXCpBEHwFixsYh9EdOKEHwyGZAG3mRlZx8kibJ+3VC8co2Sm pLqTwKzo0DxAF7sE2WCRa+bPIgTkCCVRqBFdGUt4iBTX3Hq0jAIN1hIJVuEuETlV Fab3zXO32MyVW0cVQhA0PstFwqRNBxjeu93fDCA4kp5s9Ywxgge+opO7ZcNw0npy 6KYPHSBbn6u54gEla5MKyEQBsAj1cJFPPT118TEkXeLlvt4dEGA9akLJZJFgCIO4 +1jNtxr6wub7BWbOzV1CCO1XW4L5WYWJvP2aXuZRghoUn0Nw3cuFT2XfhuHCOdiJ qoJ16+dlueUm+csfot0OPKso506POnI6SpUb3eIeeVwIL9OmDeEFYod5wYF3C1T1 ezX/lI6b1Aa0rLV2zzaTBofjnMWIRZbjUWA1ICA2Y7ksY2tMgfnUu4YwKHuj7cn1 qacrR7//VHRcA6OhO2MmLvXASGwv00g92r3g856RNrVwR9pPRk3Z1f1RGUk9ga5J 8a8SRkI7/vO5AwAg5Nm5 =bSow -----END PGP SIGNATURE----- --LbN0412894TjpI52--