public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pg.ensiie at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107857] New: recursive_mutex misses destructor if non-function call initialization is used Date: Thu, 24 Nov 2022 09:41:12 +0000 [thread overview] Message-ID: <bug-107857-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107857 Bug ID: 107857 Summary: recursive_mutex misses destructor if non-function call initialization is used Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: pg.ensiie at gmail dot com Target Milestone: --- Hello, Using GCC 11.2.0 with mingw-w64 9.0.0. I notice that there is a memory leak when using a std::recursive_mutex, as described in this issue : https://sourceforge.net/p/mingw-w64/bugs/851/. I reproduce this bug. After some research, I discover that same problem has occured for std::mutex, that was solved by this fix : https://sourceforge.net/p/mingw-w64/bugs/851/ The solution is to use function initialized and destructor for recursive_mutex as it is done for mutex when using pthread on windows. Defining _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC in os_defines.h fixes the bug. Even if I do not use it, I wonder if _GTHREAD_USE_COND_INIT_FUNC should also be set for condition variables.
next reply other threads:[~2022-11-24 9:41 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-24 9:41 pg.ensiie at gmail dot com [this message] 2023-12-15 12:17 ` [Bug libstdc++/107857] " redi at gcc dot gnu.org 2023-12-15 12:31 ` redi at gcc dot gnu.org 2023-12-15 12:32 ` redi at gcc dot gnu.org
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=bug-107857-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).