fPIC + pthreads + NB connect => trouble?
Florin Malita
mali@go.ro
Wed Jan 22 09:38:00 GMT 2003
Hope this is the right place to spill this, it gave me headaches for 2
days now :(
I'm writing a library which creates a working thread doing non-blocking
I/O. Everything looks & works OK till I try to compile the crap with
-fPIC (it will eventually end up being a shared lib). Then, the
previously nice working non-blocking connect calls start getting
blocking :( No longer do I get the EINPROGRESS errno with immediate
return. Gdb shows the thread blocking on libc's connect, even though the
socket is verified to have O_NONBLOCK set.
I've been trying all kinds of tricks to circumvent this issues but to no
success. I've even isolated the problem to a 3 functions source file: if
I compile it without -fPIC everything works fine, if I use -fPIC it just
chokes.
One interesting issue: it looks like the connects don't get blocking
right from the start but after a number of calls (the thread initiates
quite a few connections).
Has anyone ever seen this kind of weird behavior? What could I be doing
that would cause it? Could it be a compiler/glibc bug?
Any ideas/help will be appreciated.
--
Florin Malita web: http://www.malinux.net
public key: http://www.malinux.net/data/fmalita.gpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20030122/b8bc126d/attachment.sig>
More information about the Gcc-help
mailing list