{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/27970","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/27970/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/27970/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/27970/events","html_url":"https://github.com/rust-lang/rust/issues/27970","id":102666718,"number":27970,"title":"Does getaddrinfo need to take the ENV lock?","user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-23T22:24:34Z","updated_at":"2015-08-24T16:07:11Z","closed_at":null,"body":"Like the documentation for our `set_var` (setenv) says, care must be taken with mutating environment variables in a multithreaded program. See [this glibc bug #13271](https://sourceware.org/bugzilla/show_bug.cgi?id=13271) that says getaddrinfo may call getenv.\r\n\r\nIt looks like we have an unsynchronized call to getaddrinfo and this may cause trouble with glibc/Linux.\r\n\r\nSeeing glibc's attitude to setenv in multithreaded programs, `set_var` seems like a big hazard in general(?).\r\n\r\nDiscovered as an issue tangential to #27966\r\n\r\ncc @alexcrichton "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/134268078","html_url":"https://github.com/rust-lang/rust/issues/27970#issuecomment-134268078","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/27970","id":134268078,"user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T16:07:11Z","updated_at":"2015-08-24T16:07:11Z","body":"Yeah, either way the situation is tricky. We get tangled up in glibc internals."}}