An issue when unixodbc dynamically linked with ltdl library?


I am testing unixODBC in Solaris 10 environments, and find if libodbc and MyODBC driver are dynamically linked with

    ldd /usr/lib/ =>  /usr/local/lib/ =>         /usr/local/lib/ =>        /usr/lib/ =>     /usr/lib/ =>         /usr/lib/ =>     /usr/lib/

    ldd /data/nan/mysql-connector-odbc-5.2.4-src/lib/ =>  /usr/lib/ =>        /usr/lib/ =>     /usr/lib/ =>      /usr/lib/ =>         /usr/lib/ =>  /usr/local/lib/ =>         /usr/local/lib/ =>     /usr/lib/

sometimes it will connect MySQL server failed when starting up application. The log likes this:

[ODBC][6738][1361325895.588941][SQLConnect.c][1111]Can't open lib '/data/nan/mysql-connector-odbc-5.2.4-src/lib/' : file not found
[ODBC][6738][1361325895.588979][SQLConnect.c][1111]Can't open lib '/data/nan/mysql-connector-odbc-5.2.4-src/lib/' : file not found

After a while, the application runs OK.

    But if libodbc and MyODBC driver aren't dynamically linked with
    ldd /usr/local/lib/ =>         /usr/local/lib/ =>        /usr/lib/ =>     /usr/lib/ =>         /usr/local/lib/ =>     /usr/lib/

    ldd /data1/susie/mysql/tools/test_static_modify/mysql-connector-odbc-5.2.3-src/lib/ =>  /usr/local/lib/ =>        /usr/lib/ =>     /usr/lib/ =>      /usr/local/lib/ =>         /usr/local/lib/ =>         /usr/local/lib/ =>     /usr/lib/

The application runs always OK..

So I think it may be a potential issue in unixODBC. Could anyone help to check it? Thanks very much in advance!

Best Regards
Nan Xiao


All unixODBC does is call dlopen and dlsym from libltdl, I wonder if there is some statics in the lib that is causing the problem. If you don’t build unixODBC to use a exernal libltdl it uses its own version (from libtool), so again, it may be a conflict with them both hitting the same lib. You say you are using Solaris. Is the libltdl you are linking with from Sun?

What might be interesting is if you can get it to fail under truss so we could see just what the “file not found” is caused by.

I also wonder just what the MySQL driver uses libltdl for?

Leave a Reply

Your email address will not be published. Required fields are marked *