public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "internet at 123gen dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/46455] resource leaks due to missing destructors for mutexes and condvars
Date: Tue, 16 Nov 2010 08:56:00 -0000	[thread overview]
Message-ID: <bug-46455-4-nIzskkqjqu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46455-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46455

--- Comment #17 from Zouzou <internet at 123gen dot com> 2010-11-16 08:37:02 UTC ---
(In reply to comment #16)
> Created attachment 22413 [details]
> add destructors in <ext/concurrence.h>
> could you try applying this patch to ext/concurrence.h and let me know if it
> works on Windows?  I'm testing on Linux, FreeBSD and OpenBSD but they all use
> the pthreads model and I don't have a Windows system to test on.

hi,

the patch first produced a trivial compiler error:
In file included from
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/memory:7
8:0,
                 from test.cpp:15:
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ext/concurrence.h: In
destruct
or '__gnu_cxx::__recursive_mutex::~__recursive_mutex()':
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ext/concurrence.h:224:35:
erro
r: cannot convert '__gthread_recursive_mutex_t*' to '__gthread_mutex_t*' for
arg
ument '1' to 'void __gthread_mutex_destroy(__gthread_mutex_t*)'

i worked around it by making the pointer cast explicit in the __recursive_mutex
destructor:
    __gthread_mutex_destroy(reinterpret_cast<__gthread_mutex_t*>(&_M_mutex));

it then compiles fine and correctly fixes the issue at hand.


  parent reply	other threads:[~2010-11-16  8:37 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 19:45 [Bug libstdc++/46455] New: shared_ptr consuming too many semaphores on Windows internet at 123gen dot com
2010-11-12 20:23 ` [Bug libstdc++/46455] " redi at gcc dot gnu.org
2010-11-12 20:34 ` redi at gcc dot gnu.org
2010-11-12 20:59 ` internet at 123gen dot com
2010-11-12 23:07 ` redi at gcc dot gnu.org
2010-11-14 13:12 ` ktietz at gcc dot gnu.org
2010-11-14 17:54 ` redi at gcc dot gnu.org
2010-11-15 12:31 ` redi at gcc dot gnu.org
2010-11-15 13:45 ` internet at 123gen dot com
2010-11-15 13:59 ` internet at 123gen dot com
2010-11-15 14:25 ` redi at gcc dot gnu.org
2010-11-15 16:35 ` internet at 123gen dot com
2010-11-15 18:19 ` [Bug libstdc++/46455] resource leaks due to missing destructors for mutexes and condvars redi at gcc dot gnu.org
2010-11-15 18:38 ` paolo.carlini at oracle dot com
2010-11-15 19:00 ` redi at gcc dot gnu.org
2010-11-15 22:28 ` redi at gcc dot gnu.org
2010-11-16  0:53 ` redi at gcc dot gnu.org
2010-11-16  8:56 ` internet at 123gen dot com [this message]
2010-11-16 10:21 ` redi at gcc dot gnu.org
2010-11-16 10:35 ` paolo.carlini at oracle dot com
2010-11-16 11:16 ` redi at gcc dot gnu.org
2010-11-16 12:07 ` paolo.carlini at oracle dot com
2010-11-16 12:47 ` redi at gcc dot gnu.org
2010-11-16 21:46 ` redi at gcc dot gnu.org
2010-11-16 22:30 ` internet at 123gen dot com
2010-11-16 22:53 ` redi at gcc dot gnu.org
2010-11-16 23:03 ` redi at gcc dot gnu.org
2010-11-16 23:27 ` redi at gcc dot gnu.org
2010-11-16 23:38 ` redi at gcc dot gnu.org
2010-11-17  7:42 ` internet at 123gen dot com
2010-11-17  9:41 ` redi at gcc dot gnu.org
2010-11-17 22:23 ` redi at gcc dot gnu.org
2010-11-17 22:54 ` internet at 123gen dot com
2010-11-18  0:11 ` paolo.carlini at oracle dot com
2010-11-18  0:31 ` redi at gcc dot gnu.org
2010-11-18  5:39 ` redi at gcc dot gnu.org
2010-11-18 18:58 ` redi at gcc dot gnu.org
2010-11-18 19:49 ` redi at gcc dot gnu.org
2011-03-31 18:39 ` 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-46455-4-nIzskkqjqu@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: link
Be 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).