bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] Very slow startup for libtool ltdl clients (eg gnucash)


From: Peter Jeremy
Subject: [patch] Very slow startup for libtool ltdl clients (eg gnucash)
Date: Wed, 22 Mar 2006 19:27:31 +1100 (EST)

>Submitter-Id:  current-users
>Originator:    Peter Jeremy
>Organization:  
>Confidential:  no 
>Synopsis:      [patch] Very slow startup for libtool ltdl clients (eg gnucash)
>Severity:      serious
>Priority:      medium
>Category:      ports
>Class:         sw-bug
>Release:       FreeBSD 7.0-CURRENT i386
>Environment:
System: FreeBSD server.vk2pj.dyndns.org 7.0-CURRENT FreeBSD 7.0-CURRENT #29: 
Tue Mar 7 18:31:50 EST 2006 address@hidden:/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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]