From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Mar 22 18:42:52 2006 Return-Path: X-Original-To: freebsd-ports-bugs@FreeBSD.org Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7288E16A561; Wed, 22 Mar 2006 18:42:52 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9159D43E15; Wed, 22 Mar 2006 18:42:36 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail06.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k2MIgXiE023994 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 23 Mar 2006 05:42:34 +1100 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.4/8.13.4) with ESMTP id k2MIgXaf040666; Thu, 23 Mar 2006 05:42:33 +1100 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.4/8.13.4/Submit) id k2MIgXsY040665; Thu, 23 Mar 2006 05:42:33 +1100 (EST) (envelope-from peter) Date: Thu, 23 Mar 2006 05:42:33 +1100 From: Peter Jeremy To: bug-followup@FreeBSD.org, bug-libtool@gnu.org, magick-bugs@imagemagick.org, FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Message-ID: <20060322184233.GC688@turion.vk2pj.dyndns.org> References: <200603220827.k2M8RVE0076913@server.vk2pj.dyndns.org> <20060322162811.GB7573@iam.uni-bonn.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060322162811.GB7573@iam.uni-bonn.de> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: Subject: Re: ports/94826: [patch] Very slow startup for libtool ltdl clients (eg gnucash) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2006 18:42:52 -0000 I should acknowledge that the problem and fix were pointed out by joerg@britannica.bec.de On Wed, 2006-Mar-22 17:28:11 +0100, Ralf Wildenhues wrote: >I'll put adding such a test on the TODO list. I'll also put reworking >the manual loading algorithm on the TODO list, it shouldn't scale >nonlinearly in the number of loaded deplibs, however many modules we >open. I've still got a trace of all calls to lt_dlopenext() during gnucash startup but I've cleaned up the more detailed debugging output that I collected (though I could probably re-create it). I suspect it's a combination of: - both dlopen() and lt_dlopen() are recursively attempting to load dependencies - The .la file can contain duplicate dependencies (which don't appear to be stripped out) - It looks like duplicate entries in the library search path (inherited from LD_LIBRARY_PATH and added via .la) aren't deleted - Tracking lt_dlopen/lt_dlclose shows that libraries are being opened and closed multiple times during startup. Before joerg pointed me in the right direction, I was looking at adding caching to lt_dlopenext() or lt_dlopen() but hadn't worked out how to correctly track reference counts across open/close calls. >Thanks for the patch. A question before I apply it: this should work on >DragonFly as well, right? Could somebody confirm this, to avoid another >bug report to this end? joerg found the problem using KDE on DragonFly. >Also, has the FreeBSD rtld always supported loading dependent libraries >upon dlopen() (including honoring DT_RPATH entries in the module) or was >this not working at some point in the past? AFAIK, it's worked since FreeBSD transitioned to ELF (FreeBSD3.0). I'm not sure about the a.out rtld but FreeBSD 2.x is ancient history. -- Peter Jeremy