public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-10281] libphobos: Don't call __gthread_key_delete in the emutls destroy function. Date: Fri, 19 Nov 2021 14:14:08 +0000 (GMT) [thread overview] Message-ID: <20211119141408.3943B3858D3C@sourceware.org> (raw) https://gcc.gnu.org/g:910d2b4b7513b6bfe02777d44cd5377c22198086 commit r10-10281-g910d2b4b7513b6bfe02777d44cd5377c22198086 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Fri Nov 19 14:26:07 2021 +0100 libphobos: Don't call __gthread_key_delete in the emutls destroy function. Fixes a EXC_BAD_ACCESS issue seen on Darwin when the libphobos DSO gets unloaded. Based on reading libgcc's emutls implementation, as it doesn't call __gthread_key_delete directly, neither should libphobos. libphobos/ChangeLog: * libdruntime/gcc/emutls.d (emutlsDestroyThread): Don't remove entry from global array. (_d_emutls_destroy): Don't call __gthread_key_delete. (cherry picked from commit d686cb0d740b0278fdbd7915f43faff14b203888) Diff: --- libphobos/libdruntime/gcc/emutls.d | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libphobos/libdruntime/gcc/emutls.d b/libphobos/libdruntime/gcc/emutls.d index 1436cdb35a5..7e4a1d6f8de 100644 --- a/libphobos/libdruntime/gcc/emutls.d +++ b/libphobos/libdruntime/gcc/emutls.d @@ -229,9 +229,6 @@ void** emutlsAlloc(shared __emutls_object* obj) nothrow @nogc extern (C) void emutlsDestroyThread(void* ptr) nothrow @nogc { auto arr = cast(TlsArray*) ptr; - emutlsMutex.lock_nothrow(); - emutlsArrays.remove(arr); - emutlsMutex.unlock_nothrow(); foreach (entry; *arr) { @@ -308,9 +305,6 @@ void _d_emutls_scan(scope void delegate(void* pbeg, void* pend) nothrow cb) noth // Call this after druntime has been unloaded void _d_emutls_destroy() nothrow @nogc { - if (__gthread_key_delete(emutlsKey) != 0) - abort(); - (cast(Mutex) _emutlsMutex.ptr).__dtor(); destroy(emutlsArrays); }
reply other threads:[~2021-11-19 14:14 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211119141408.3943B3858D3C@sourceware.org \ --to=ibuclaw@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).