public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] [libstdc++] do not destruct mutex_pool mutexes Date: Thu, 23 Feb 2023 13:48:14 +0000 (GMT) [thread overview] Message-ID: <20230223134814.552FE3858020@sourceware.org> (raw) https://gcc.gnu.org/g:bb924c8f32b64ba6b381e46c434e0c8c0acb0291 commit bb924c8f32b64ba6b381e46c434e0c8c0acb0291 Author: Alexandre Oliva <oliva@adacore.com> Date: Thu Feb 23 10:30:22 2023 -0300 [libstdc++] do not destruct mutex_pool mutexes On vxworks, after destroying the semaphore used to implement a mutex, __gthread_mutex_lock fails and __gnu_cxx::__mutex::lock calls __throw_concurrence_lock_error. Nothing ensures the mutex_pool mutexes survive init-once objects containing _Safe_sequence_base. If such an object completes construction before mutex_pool initialization, it will be registered for atexit destruction after the mutex_pool mutexes, so the _M_detach_all() call in the _Safe_sequence_base dtor will use already-destructed mutexes, and basic_string/requirements/citerators_cc fails calling terminate. This patch fixes this problem by ensuring the mutex pool mutexes are constructed on demand, on a statically-allocated buffer, but never destructed. for libstdc++-v3/ChangeLog * src/c++11/shared_ptr.cc (__gnu_internal::get_mutex): Avoid destruction of the mutex pool. Diff:
next reply other threads:[~2023-02-23 13:48 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-23 13:48 Alexandre Oliva [this message] -- strict thread matches above, loose matches on Subject: below -- 2023-02-22 14:49 Alexandre Oliva 2023-02-16 11:13 Alexandre Oliva
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=20230223134814.552FE3858020@sourceware.org \ --to=aoliva@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).