Date: Fri, 6 Dec 2013 03:25:52 +0100 From: Michael Gmelin <freebsd@grem.de> To: Konstantin Belousov <kostikbel@gmail.com> Cc: David Chisnall <theraven@freebsd.org>, Brooks Davis <brooks@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org>, Matthias Andree <mandree@FreeBSD.org>, "freebsd-ports@freebsd.org Ports" <freebsd-ports@freebsd.org> Subject: Re: Position independent code and global destructor order (devel/ice) Message-ID: <20131206032552.59672a5b@bsd64.grem.de> In-Reply-To: <20131205182058.5479b1ff@bsd64.grem.de> References: <6900C006-2A57-4EAF-B19A-629A85CBA001@FreeBSD.org> <20130626210534.GY91021@kib.kiev.ua> <A60BFADA-E358-4363-8BED-E154AB327C6B@FreeBSD.org> <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> <20131205182058.5479b1ff@bsd64.grem.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 5 Dec 2013 18:20:58 +0100 Michael Gmelin <freebsd@grem.de> wrote: > On Thu, 5 Dec 2013 19:07:28 +0200 > Konstantin Belousov <kostikbel@gmail.com> 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. > I tested your patch on 10-BETA2 and 10-BETA3. I built our complete production environment from scratch, ran a huge number of unit and integration tests. Everything works as expected, including Ice's "Schwarz Counter" implementation (http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter). So as far as I can tell this fixes the problem, while still accomplishing the goals of r211706. Thanks for work, Michael -- Michael Gmelin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131206032552.59672a5b>