Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2006 05:42:33 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        bug-followup@FreeBSD.org, bug-libtool@gnu.org, magick-bugs@imagemagick.org, FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/94826: [patch] Very slow startup for libtool ltdl clients (eg gnucash)
Message-ID:  <20060322184233.GC688@turion.vk2pj.dyndns.org>
In-Reply-To: <20060322162811.GB7573@iam.uni-bonn.de>
References:  <200603220827.k2M8RVE0076913@server.vk2pj.dyndns.org> <20060322162811.GB7573@iam.uni-bonn.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060322184233.GC688>