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

Zachary Bedell zaclist at adirondack.net
Thu Mar 3 17:21:19 GMT 2005

Hash: SHA1

On Mar 3, 2005, at 2:12 AM, Nick Gorham wrote:
> 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.

That was the problem.  ODBC was compiled w/ pthreads while Helix does 
its own threading somehow and doesn't use libpthread at all. I 
recompiled unixODBC and FreeTDS without threads, and Helix isn't 
crashing anymore!

I just tried a build of my object linked with -lpthread, and it crashes 
on load the same as including the threaded -lodbc used to.  Makes 

I guess my next question is can I install both a threaded and a 
non-threaded copy of unixODBC side-by-side somehow?  I know I can - 
- --prefix=/somewhere/else on configure, but that seems like a bit of a 
hack when it comes to anyone else grabbing a binary distro of Helix and 
just using it.

Better yet, is there any way to get my code to behave "pthread-like" 
enough to coexist with a threaded unixODBC?  I'd like to contribute my 
port back to the Helix project, but I'm afraid that with a caveat like 
"you need a threadless ODBC or it crashes," they might reject it.

The "first" ODBC project of mine that I mentioned is an Apache module 
to do authentication against an ODBC database.  I just double checked, 
and Apache links libpthread.  Even with the non-threaded unixODBC and 
FreeTDS in place, Apache still runs fine authenticating with my module. 
  Does anyone know off the top of their head how that works, or shall I 
be digging through Apache's code for hints?

Thanks for the help with this!

Best regards,
Zac Bedell

Passionate hatred can give meaning and purpose to an empty life.
		-- Eric Hoffer
- ------------------------------------------------------
Brought to you by MacOS, running on host Aramis
Running for:  8 days,  2 hours, 10 minutes
Version: GnuPG v1.2.3 (Darwin)


More information about the unixODBC-support mailing list