{"action":"created","issue":{"url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/223","repository_url":"https://api.github.com/repos/alexcrichton/curl-rust","labels_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/223/labels{/name}","comments_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/223/comments","events_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/223/events","html_url":"https://github.com/alexcrichton/curl-rust/issues/223","id":349912017,"node_id":"MDU6SXNzdWUzNDk5MTIwMTc=","number":223,"title":"curl handle stashed to TLS hangs shutdown on various windows versions","user":{"login":"mitsuhiko","id":7396,"node_id":"MDQ6VXNlcjczOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7396?v=4","gravatar_id":"","url":"https://api.github.com/users/mitsuhiko","html_url":"https://github.com/mitsuhiko","followers_url":"https://api.github.com/users/mitsuhiko/followers","following_url":"https://api.github.com/users/mitsuhiko/following{/other_user}","gists_url":"https://api.github.com/users/mitsuhiko/gists{/gist_id}","starred_url":"https://api.github.com/users/mitsuhiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitsuhiko/subscriptions","organizations_url":"https://api.github.com/users/mitsuhiko/orgs","repos_url":"https://api.github.com/users/mitsuhiko/repos","events_url":"https://api.github.com/users/mitsuhiko/events{/privacy}","received_events_url":"https://api.github.com/users/mitsuhiko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-13T07:12:50Z","updated_at":"2018-08-14T00:33:42Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"We have not fully identified what the cause it but it would appear that if a curl easy handle is put to TLS on windows, it can cause hangs on shutdown on certain versions. I'm entirely unsure what causes this and the exact conditions of the hang are very mysterious.\r\n\r\nWhat we know so far is that if the handle is made and put to TLS everything is fine. If the handle however did an HTTP request first, is kept in TLS the program will hang on shutdown the first time after the HTTP request is made but if the program is run a second time it succeeds and only will start blocking again after some time has passed (6 hours?). Even a computer restart does not bring the program back to hanging. We saw this with Windows 7, Windows Server 2012.\r\n\r\nThis sounds very much like something in curl itself but it's mysterious nontheless. We currently work around by resetting the handles before shutdown on all threads that have one."},"comment":{"url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/comments/412712684","html_url":"https://github.com/alexcrichton/curl-rust/issues/223#issuecomment-412712684","issue_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/223","id":412712684,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjcxMjY4NA==","user":{"login":"alexcrichton","id":64996,"node_id":"MDQ6VXNlcjY0OTk2","avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T00:33:42Z","updated_at":"2018-08-14T00:33:42Z","author_association":"OWNER","body":"Oh dear, this definitely sounds bad! I agree that this is probably a curl issue, but I can at least chime in and say that I've definitely seen my fair share of weirdness of TLS destructors and windows. At least in the standard library we have to update tests to avoid that in the past because it causes various hangs and crashes. \r\n\r\nI've also never managed to bottom out the issues here, I've sort of just prayed all along that it's not a bug in libstd (or in this case libcurl) and it's instead just a weird Windows issue.\r\n\r\nIn any case I definitely agree that manually resetting TLS vars is the best way to go here, that'll make sure that hopefully no code executes on a TLS destructor"}}
{"actor":{"display_login":"alexcrichton"}}