repeatedly opening the same .so(s) is slow?

Eric Schuele e.schuele at computer.org
Mon Mar 20 16:49:59 UTC 2006


Hello,

Sorry if the subject is misleading, not sure how to label this one.

I have a port (gnucash) which takes 3-4 minutes to open on a 2.6GHz 
machine.  It used to take 15-20 seconds till all of the libtool changes.

I have no idea if the symptom is related to libtool or not.  Others have 
said it is not... but that's when the problems began, just for 
reference.  FWIW, when I had trouble due to libtool, I simply formatted 
my machine, reinstalled OS and all ports.  So this issue is occurring on 
a 'clean' machine.

But here is what I have found, and it looks odd to me.

Using truss, I can see that gnucash/guile is trying to open a dozen or 
two files, repeatedly.  It fails attempting to open it the first few 
times everytime it tries to access it, because it is traversing the 
LD_LIBRARY_PATH:

open("/lib/libglib-12.la",0x0,0666)              ERR#2 'No such file or 
directory'
open("/usr/lib/libglib-12.la",0x0,0666)          ERR#2 'No such file or 
directory'
open("/usr/local/lib/libglib-12.la",0x0,0666)    ERR#2 'No such file or 
directory'
open("/usr/X11R6/lib/gnucash/libglib-12.la",0x0,0666) ERR#2 'No such 
file or directory'
open("/usr/X11R6/lib/libglib-12.la",0x0,0666)    ERR#2 'No such file or 
directory'
open("/usr/X11R6/lib/gnucash/libglib-12.la",0x0,0666) ERR#2 'No such 
file or directory'
open("/usr/local/lib/libglib-12.la",0x0,0666)    ERR#2 'No such file or 
directory'
open("/lib/libglib-12.la",0x0,0666)              ERR#2 'No such file or 
directory'
open("/usr/lib/libglib-12.la",0x0,0666)          ERR#2 'No such file or 
directory'
open("/usr/local/lib/libglib-12.la",0x0,0666)    ERR#2 'No such file or 
directory'
open("/usr/X11R6/lib/gnucash/libglib-12.la",0x0,0666) ERR#2 'No such 
file or directory'
open("/usr/X11R6/lib/libglib-12.la",0x0,0666)    ERR#2 'No such file or 
directory'
open("/usr/X11R6/lib/gnucash/libglib-12.la",0x0,0666) ERR#2 'No such 
file or directory'
open("/usr/local/lib/libglib-12.la",0x0,0666)    ERR#2 'No such file or 
directory'
open("/lib/libglib-12.la",0x0,0666)              ERR#2 'No such file or 
directory'
open("/usr/lib/libglib-12.la",0x0,0666)          ERR#2 'No such file or 
directory'
open("libglib-12.la",0x0,0666)                   ERR#2 'No such file or 
directory'
access("/lib/libglib-12.so",4)                   ERR#2 'No such file or 
directory'
access("/usr/lib/libglib-12.so",4)               ERR#2 'No such file or 
directory'
access("/usr/local/lib/libglib-12.so",4)         = 0 (0x0)

Now I said a dozen or two files repeatedly.  It is 12-20 files maybe... 
but it is attempting to open them *hundreds of thousands of times*!  It 
goes on and on and on...

I am assuming this is what is causing the long startup time.  So I have 
been working towards helping it find the right files the first time 
around.  I have manipulated the gnucash environments LD_LIBRARY_PATH a 
bit and helped some... but it is only a drop in the bucket.  I have 
thought of placing symlinks in the folder(s) where it first looks for 
any given file, to make sure it finds the file... but this does not seem 
quite right either.

What I'm wondering is.... what is the lists opinion on how to best fix 
this type of a problem.  Is this even the cause of my long startup?

I have spoken with one or two of the gnucash devs, they seem to think 
this is unique to FreeBSD, meaning they have not seen this problem on 
any other platform.  They said it might have to do with how FreeBSD 
handles how files are opened up many times recursively!?

If there is a more appropriate list, please let me know.

Thanks in advance.
-- 
Regards,
Eric


More information about the freebsd-hackers mailing list