{"action":"closed","issue":{"url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/226","repository_url":"https://api.github.com/repos/alexcrichton/curl-rust","labels_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/226/comments","events_url":"https://api.github.com/repos/alexcrichton/curl-rust/issues/226/events","html_url":"https://github.com/alexcrichton/curl-rust/issues/226","id":359879094,"node_id":"MDU6SXNzdWUzNTk4NzkwOTQ=","number":226,"title":"Thread panicked at 'cannot access a TLS value during or after it is destroyed: AccessError'","user":{"login":"mentegy","id":5845992,"node_id":"MDQ6VXNlcjU4NDU5OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5845992?v=4","gravatar_id":"","url":"https://api.github.com/users/mentegy","html_url":"https://github.com/mentegy","followers_url":"https://api.github.com/users/mentegy/followers","following_url":"https://api.github.com/users/mentegy/following{/other_user}","gists_url":"https://api.github.com/users/mentegy/gists{/gist_id}","starred_url":"https://api.github.com/users/mentegy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mentegy/subscriptions","organizations_url":"https://api.github.com/users/mentegy/orgs","repos_url":"https://api.github.com/users/mentegy/repos","events_url":"https://api.github.com/users/mentegy/events{/privacy}","received_events_url":"https://api.github.com/users/mentegy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-13T12:43:27Z","updated_at":"2018-09-14T20:14:23Z","closed_at":"2018-09-14T20:14:23Z","author_association":"NONE","body":"App written in C has some bindings to my rust lib. When C app receives SIGINT it calls the function (using c `atexit`) which perform a http request, but the threads is panicking:\r\n```\r\nthread '<unnamed>' panicked at 'cannot access a TLS value during or after it is destroyed: AccessError', libcore/result.rs:945:5\r\nstack backtrace:\r\n   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace\r\n             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49\r\n   1: std::sys_common::backtrace::print\r\n             at libstd/sys_common/backtrace.rs:71\r\n             at libstd/sys_common/backtrace.rs:59\r\n   2: std::panicking::default_hook::{{closure}}\r\n             at libstd/panicking.rs:211\r\n   3: std::panicking::default_hook\r\n             at libstd/panicking.rs:227\r\n   4: std::panicking::rust_panic_with_hook\r\n             at libstd/panicking.rs:511\r\n   5: std::panicking::continue_panic_fmt\r\n             at libstd/panicking.rs:426\r\n   6: rust_begin_unwind\r\n             at libstd/panicking.rs:337\r\n   7: core::panicking::panic_fmt\r\n             at libcore/panicking.rs:92\r\n   8: core::result::unwrap_failed\r\n   9: <std::thread::local::LocalKey<T>>::with\r\n  10: curl::easy::handler::header_cb\r\n  11: Curl_client_chop_write\r\n  12: Curl_http_readwrite_headers\r\n  13: Curl_readwrite\r\n  14: multi_runsingle\r\n  15: curl_multi_perform\r\n  16: curl_easy_perform\r\n  17: curl::easy::handle::Transfer::perform\r\n```\r\nI suspect that SIGINT closes some rust curl resources and then the code within `atexit` cannot do http requests anymore. Is there anyway to avoid a thread panic and perform a http request on  `atexit` ?"}}
{"actor":{"display_login":"alexcrichton"}}