Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2006 19:27:31 +1100 (EST)
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        FreeBSD-gnats-submit@FreeBSD.org, bug-libtool@gnu.org, magick-bugs@imagemagick.org
Subject:   ports/94826: [patch] Very slow startup for libtool ltdl clients (eg gnucash)
Message-ID:  <200603220827.k2M8RVE0076913@server.vk2pj.dyndns.org>
Resent-Message-ID: <200603220830.k2M8UESq077874@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         94826
>Category:       ports
>Synopsis:       [patch] Very slow startup for libtool ltdl clients (eg gnucash)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 22 08:30:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Peter Jeremy
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD server.vk2pj.dyndns.org 7.0-CURRENT FreeBSD 7.0-CURRENT #29: Tue Mar 7 18:31:50 EST 2006 root@server.vk2pj.dyndns.org:/var/obj/k7/usr/src/sys/server i386

libtool-1.5.22
guile-1.6.7
ImageMagick-6.2.5.5

>Description:
	libtool (ltdl) includes a check to determine whether shared
	libraries on the host OS correctly handle dependencies or whether
	libltdl needs to manually manage shared library dependencies.

	This check is implemented by hard-wiring the answer for various
	OS's, rather than testing the actual OS behaviour using a test case.
	If an OS is not listed, libltdl assumes that the OS cannot handle
	shared library dependencies.  FreeBSD is not listed in the known
	OSs and libltdl therefore defaults to manual dependency loading.

	This results in massive overheads in loading programs that use
	many shared libraries.  As an example, gnucash uses 122 shared
	libraries and took 15 minutes of system time to start on an XP-1800
	and a system call trace shows 24e6 open() calls.
	With libltdl_cv_sys_dlopen_deplibs=yes, the startup time drops
	to 10 seconds.

	The critical change is the following change in output from configure:
-checking whether deplibs are loaded by dlopen... unknown
+checking whether deplibs are loaded by dlopen... yes

	This bug also affects other programs with ltdl embedded in them.
	Based on my collection of ports, this includes guile (prior to 1.7.2)
	and ImageMagick-6.2.5.5.

>How-To-Repeat:
	Start gnucash and watch the system call rate.
>Fix:
	Ideally, libtool should implement a test case to determine whether
	an OS tracks shared library dependencies or now.  The following
	patches just flag that FreeBSD does track dependencies.  Any one
	of the following patches should fix the problem on libtool and any
	application that embeds libltdl.

--- libltdl/acinclude.m4~	Mon Dec 19 09:13:49 2005
+++ libltdl/acinclude.m4	Wed Mar 22 18:43:11 2006
@@ -6524,6 +6524,9 @@
     # If you are looking for one http://www.opendarwin.org/projects/dlcompat
     libltdl_cv_sys_dlopen_deplibs=yes
     ;;
+  freebsd*)
+    libltdl_cv_sys_dlopen_deplibs=yes
+    ;;
   gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
     # GNU and its variants, using gnu ld.so (Glibc)
     libltdl_cv_sys_dlopen_deplibs=yes
--- libltdl/configure~	Mon Dec 19 09:13:59 2005
+++ libltdl/configure	Wed Mar 22 18:43:11 2006
@@ -21121,6 +21121,9 @@
     # If you are looking for one http://www.opendarwin.org/projects/dlcompat
     libltdl_cv_sys_dlopen_deplibs=yes
     ;;
+  freebsd*)
+    libltdl_cv_sys_dlopen_deplibs=yes
+    ;;
   gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
     # GNU and its variants, using gnu ld.so (Glibc)
     libltdl_cv_sys_dlopen_deplibs=yes
--- ltdl.m4~	Mon Dec 19 08:53:17 2005
+++ ltdl.m4	Wed Mar 22 18:43:11 2006
@@ -127,6 +127,9 @@
     # If you are looking for one http://www.opendarwin.org/projects/dlcompat
     libltdl_cv_sys_dlopen_deplibs=yes
     ;;
+  freebsd*)
+    libltdl_cv_sys_dlopen_deplibs=yes
+    ;;
   gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
     # GNU and its variants, using gnu ld.so (Glibc)
     libltdl_cv_sys_dlopen_deplibs=yes


>Release-Note:
>Audit-Trail:
>Unformatted:



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