This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/13271] getaddrinfo is not thread safe
- From: "mol at astron dot nl" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 07 Oct 2011 17:49:35 +0000
- Subject: [Bug libc/13271] getaddrinfo is not thread safe
- Auto-submitted: auto-generated
- References: <bug-13271-131@http.sourceware.org/bugzilla/>
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.