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 #4 from Rich Felker <bugdal at aerifal dot cx> 2011-10-07 16:29:26 UTC ---
2.9.1 states very explicitly, "any function dependent on any
environment variable is not thread-safe if another thread is modifying the
environment". The only potential wiggle-room to claim that glibc is
non-conformant is that getaddrinfo is not documented (by the standard or by the
implementation) as depending on the environment.

With that said, I agree that Ulrich Drepper is wrong to claim that modifying
the environment in a multi-threaded program is not allowed. It can be done
safely in many situations, such as when all but one thread is purely
computational or only invoking only async-signal-safe functions. It should also
be perfectly safe if you modify extern char **environ; (or the array it points
to) directly in only atomic ways and don't clobber any environment memory that
other threads could still be referencing.

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