From owner-freebsd-current@FreeBSD.ORG Wed Sep 14 21:10:06 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E575C106566B; Wed, 14 Sep 2011 21:10:05 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp5-g21.free.fr (unknown [IPv6:2a01:e0c:1:1599::14]) by mx1.freebsd.org (Postfix) with ESMTP id 3AA158FC1B; Wed, 14 Sep 2011 21:10:02 +0000 (UTC) Received: from endor.tataz.chchile.org (unknown [82.233.239.98]) by smtp5-g21.free.fr (Postfix) with ESMTP id 273AAD480FB; Wed, 14 Sep 2011 23:09:55 +0200 (CEST) Received: from felucia.tataz.chchile.org (felucia.tataz.chchile.org [192.168.1.9]) by endor.tataz.chchile.org (Postfix) with ESMTP id EE18A33E71; Wed, 14 Sep 2011 21:09:54 +0000 (UTC) Received: by felucia.tataz.chchile.org (Postfix, from userid 1000) id E3AB8A11E0; Wed, 14 Sep 2011 21:09:54 +0000 (UTC) Date: Wed, 14 Sep 2011 23:09:54 +0200 From: Jeremie Le Hen To: Kostik Belousov Message-ID: <20110914210954.GC7863@felucia.tataz.chchile.org> References: <20110914123607.GM65366@felucia.tataz.chchile.org> <20110914125953.GX17489@deviant.kiev.zoral.com.ua> <20110914154221.GB7863@felucia.tataz.chchile.org> <20110914200456.GE17489@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110914200456.GE17489@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Peter Pentchev , freebsd-current@freebsd.org, David Xu , Jeremie Le Hen , Oliver Lehmann Subject: Re: Segfault in libthr.so on 9.0-BETA2 (with stunnel FWIW) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2011 21:10:06 -0000 On Wed, Sep 14, 2011 at 11:04:56PM +0300, Kostik Belousov wrote: > > tzload() allocates ~80KB for the local variables. The backtrace you provided > shows the nested call to tzload(), so there is total 160KB of the stack > space consumed. Isn't it a little bit hungry? To do this on stack? Softwares with a large amount of threads might want to reduce their stack size dramatically, and so much space might not be available. > By default, stack for the amd64 thread is 4MB, that should be plenty. This > is not the case for ezm3. Possibly, stunnel also reduces the size of the > thread stack. Correct, I checked stunnel source, it reduces it to 64KB by default. However it is possible to override it from the config file. Raising solves the problem indeed. > Please, try the patch below. I did not tested it, only compiled. I see > that now tzload allocates only ~300 bytes on the stack. I've also tried it, leaving the default stack size chosen by stunnel. It works. Please go ahead and commit it if it's still possible. Thanks. Regards, -- Jeremie Le Hen Men are born free and equal. Later on, they're on their own. Jean Yanne