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 #3 from Jan David Mol <mol at astron dot nl> 2011-10-07 14:56:17 UTC ---
According to section 2.9.1 you quote, a program is still thread safe if it
writes environment variables, and thus allows setenv(), it just can't read them
at the same time. Thus the issue arises that getaddrinfo is not thread-safe
under some circumstances, i.e. when there is no concurrent use of setenv() and
friends. This violates the POSIX requirements for getaddrinfo:

The freeaddrinfo() and getaddrinfo() functions shall be thread-safe.

I don't see any exceptions being noted or any access to environment variables
being mentioned?

@Ulrich: where does it state that concurrent threads cannot modify the
environment at all? Section 2.9.1 seems to directly contradict that statement. 
In fact, the glibc documentation does not provide any hint towards the fact
that getaddrinfo will clash with setenv, nor does it forbid the use of setenv
in multithreaded programs as you seem to imply.

-- 
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]