質問

Can anyone provide any insight or way to debug why ltdl is failing to load my library? As you can see from the partial strace output it succeeds in opening the library, then reports file not found, and then moves on to successfully load another library built the same way. How can I debug this? I have been googling for ages and found no useful ways of debugging it.

open("server/modules/smtp.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("server/modules/smtp.so", O_RDONLY) = 3
getcwd("/home/david/Documents/workspace/dvnmon", 128) = 39
1327209900.751672 3602 Failed to open server/modules/smtp: file not found
open("server/modules/snmp.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("server/modules/snmp.so", O_RDONLY) = 3
getcwd("/home/david/Documents/workspace/dvnmon", 128) = 39
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/usr/lib64/libnetsnmp.so.15", O_RDONLY) = 3
open("/usr/lib64/libcrypto.so.1.0.0", O_RDONLY) = 3
open("/lib64/libz.so.1", O_RDONLY)      = 3
1327209900.800507 3602 Plugin CSNMPMonitor interface version 0.1 loaded
役に立ちましたか?

解決

lt_dlopen() reports FILE_NOT_FOUND whenever it fails to load a dynamic library. This can happen even if the file exists.

I would first compare the output of ldd server/modules/smtp.so and that of ldd server/modules/snmp.so. Maybe one of the two has a missing dependency?

You may also want to try export LD_DEBUG=all (see man ld.so for details).

Also it's not clear from your question if the files in server/modules/ are actually Libtool modules. If they are, why aren't the *.la files present? These files may specify dependent libraries that need to be loaded first.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top