From owner-freebsd-ports@FreeBSD.ORG Thu Dec 5 17:27:41 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5ACF41B9 for ; Thu, 5 Dec 2013 17:27:41 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id 9786D1D9B for ; Thu, 5 Dec 2013 17:27:39 +0000 (UTC) Received: (qmail 15985 invoked by uid 89); 5 Dec 2013 17:20:58 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@194.97.158.66) by mail.grem.de with ESMTPA; 5 Dec 2013 17:20:58 -0000 Date: Thu, 5 Dec 2013 18:20:58 +0100 From: Michael Gmelin To: Konstantin Belousov Subject: Re: Position independent code and global destructor order (devel/ice) Message-ID: <20131205182058.5479b1ff@bsd64.grem.de> In-Reply-To: <20131205170728.GF59496@kib.kiev.ua> References: <6900C006-2A57-4EAF-B19A-629A85CBA001@FreeBSD.org> <20130626210534.GY91021@kib.kiev.ua> <20130626231741.497f7a9b@bsd64.grem.de> <20130626212833.GB91021@kib.kiev.ua> <20130627015602.7a437aad@bsd64.grem.de> <51CC411C.4060105@FreeBSD.org> <20130627140428.GI91021@kib.kiev.ua> <20130827144507.385a552c@bsd64.grem.de> <20131130223427.3d95ae7c@bsd64.grem.de> <20131205170728.GF59496@kib.kiev.ua> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: David Chisnall , Brooks Davis , Dimitry Andric , Matthias Andree , "freebsd-ports@freebsd.org Ports" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Dec 2013 17:27:41 -0000 On Thu, 5 Dec 2013 19:07:28 +0200 Konstantin Belousov wrote: > If you provided link to the original discussion, it would take much > less energy and time to refresh the memory. Forgot to include it, sorry. Thanks for you response and the patch. > > I looked over this, and I think that r211706 can be refined, by only > calling atexit hooks for 'wrong' dso when the call to __cxa_finalize() > is from the real dlclose(), as opposed to the process exit. For me, > with the world where the patch is applied, your 'major tom' test > passes. Makes sense. > > Of course, when dso1 registers __cxa_atexit hook located in dso2, and > dso2 is unloaded before dso1, the hooks are called in the wrong order > still, but the only alternatives there are either crash or do not call > such hooks at all. Sounds like a good solution. PHP (and similar) crashes are avoided while clean code isn't affected. I will try the patch in my specific use case to make sure it works there as well. -- Michael Gmelin