This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/13271] getaddrinfo is not thread safe


http://sourceware.org/bugzilla/show_bug.cgi?id=13271

--- Comment #5 from Jan David Mol <mol at astron dot nl> 2011-10-07 17:49:35 UTC ---
The reason I report this is because I saw my application crash repeatedly in a
validly used getaddrinfo, because another thread invalidated environ through
setenv. I've since replaced the setenv call, but what worries me is that
nothing in the documentation of glibc or POSIX could have indicated for me that
this could happen.

Although I personally would consider a function only thread safe if no valid
use can cause undefined behaviour due to multithreaded use, I do recognise that
in this case practicality is important to consider. After all, dropping support
for the environment variables used in getaddrinfo and other functions, or
wrapping getenv with the same lock that setenv already has, might not be
desirable either.

Since you are the devs and not me, it is up to you, but I kindly request that
you reopen this bug as a documentation one at least. The setenv man page family
could carry a warning indicating that it makes the behaviour of concurrently
running thread-safe (glibc) functions undefined?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]