threading and dlopen()

Heiko Wundram (Beenic) wundram at beenic.net
Tue Dec 18 13:18:48 PST 2007


Am Dienstag, 18. Dezember 2007 21:34:33 schrieb Markus Hoenicka:
> My (limited) analysis makes me think this is some sort of a threading
> issue aggravated by the fact that the code is dlopen()ed (remember the
> same code works ok if compiled into a standalone app). BTW the
> firebird client library is the only library supported by libdbi which
> uses threads. All other drivers do not use threads and work ok.

Have you tried compiling your program with

gcc -fpic -pthread ...

? I don't have any more insight into this problem, at least as I'm not using 
dbi and as such am not able to reproduce it, but I'd guess that if your 
program doesn't conform to the platform's required thread semantics (which 
are turned on by -fpic -pthread) but uses code that does require this, you're 
bound for trouble.

-- 
Heiko Wundram
Product & Application Development


More information about the freebsd-questions mailing list