[unixODBC-support] Shared lib crash on load when linked with -lodbc or dlopen called

Nick Gorham nick.gorham at easysoft.com
Thu Mar 3 07:12:50 GMT 2005

Zachary Bedell wrote:

> Hash: SHA1
> Hello all!
> I really hate to post this to the mailing list because I feel too much 
> like a begging newbie.  It seems like I must be missing something 
> obvious, but after three days of solid hacking, I'm still in the 
> dark.  That said, I *am* a newbie when it comes to ODBC as this is 
> only the second project I've tried with unixODBC.  (The first project 
> is working pretty well now, so I know how to do something right.)


My first guess is you have a mix of threaded and non-threded code. I 
have seen exactly this sort of thing. If your main app thats callinf 
dlopen is linked with threads, then your unixodbc must be built with 
threads and vice versa. if you have a mix, you will get just what you 
are seeing.

I suspect, its because the state information that dlopen saves differs 
with threaded and non threaded implemetations, and I think if the code 
is compiled expecting one, and then at run time, because the other 
version has already been loaded, the process loads the existing 
function, which doesn't match how it was compiled.

Try doing a ldd on your app, and libodbc.so if one has a link to 
libpthreads and the other doesn't, that would be my guess.


More information about the unixODBC-support mailing list