From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51363 invoked by alias); 21 Oct 2015 13:50:31 -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 51329 invoked by uid 89); 21 Oct 2015 13:50:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 3 recipients X-HELO: mail-lf0-f45.google.com Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 21 Oct 2015 13:50:29 +0000 Received: by lfaz124 with SMTP id z124so21327279lfa.1; Wed, 21 Oct 2015 06:50:26 -0700 (PDT) X-Received: by 10.25.30.84 with SMTP id e81mr3588421lfe.48.1445435426085; Wed, 21 Oct 2015 06:50:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.21.228 with HTTP; Wed, 21 Oct 2015 06:49:56 -0700 (PDT) In-Reply-To: <20151021105300.GN5319@calimero.vinschen.de> References: <20151021105300.GN5319@calimero.vinschen.de> From: Yucong Sun Date: Wed, 21 Oct 2015 13:50:00 -0000 Message-ID: Subject: Re: Jemalloc under CYGWIN To: corinna-cygwin@cygwin.com, cygwin-developers@cygwin.com, cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00345.txt.bz2 > What exactly is the malloc problem you're seeing? 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. A quick fix would be somehow make pthread always use system malloc/free, which shouldn't be that bad. 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 . So, the quickest fix would be to make cygwin's thread implementations always use system malloc. some small workarounds in jemalloc would be needed afterwards, but it should be a nice starting point. -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51382 invoked by alias); 21 Oct 2015 13:50:31 -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 51350 invoked by uid 9078); 21 Oct 2015 13:50:31 -0000 Received: (qmail 51329 invoked by uid 89); 21 Oct 2015 13:50:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 3 recipients X-HELO: mail-lf0-f45.google.com Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 21 Oct 2015 13:50:29 +0000 Received: by lfaz124 with SMTP id z124so21327279lfa.1; Wed, 21 Oct 2015 06:50:26 -0700 (PDT) X-Received: by 10.25.30.84 with SMTP id e81mr3588421lfe.48.1445435426085; Wed, 21 Oct 2015 06:50:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.21.228 with HTTP; Wed, 21 Oct 2015 06:49:56 -0700 (PDT) In-Reply-To: <20151021105300.GN5319@calimero.vinschen.de> References: <20151021105300.GN5319@calimero.vinschen.de> From: Yucong Sun Date: Wed, 21 Oct 2015 14:15:00 -0000 Message-ID: Subject: Re: Jemalloc under CYGWIN To: corinna-cygwin@cygwin.com, cygwin-developers@cygwin.com, cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00346.txt.bz2 Message-ID: <20151021141500.DjE26gkhW7MsgvjxY-mneGqOT-LqtJUkNZxvXPkOfQ8@z> > What exactly is the malloc problem you're seeing? 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. A quick fix would be somehow make pthread always use system malloc/free, which shouldn't be that bad. 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 . So, the quickest fix would be to make cygwin's thread implementations always use system malloc. some small workarounds in jemalloc would be needed afterwards, but it should be a nice starting point. -- 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