public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/52839] double free or corruption running tr1/.../default_weaktoshared.exe
Date: Thu, 05 Apr 2012 13:03:00 -0000	[thread overview]
Message-ID: <bug-52839-4-yRMjDM6i3M@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52839-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-05 13:02:53 UTC ---
(In reply to comment #17)
> I wonder if the problem is that libstdc++ is using both atomics and
> pthread_mutex protected manipulation of the same variable?  That of course
> would fail.

I'm pretty sure that can't happen. We always access those variables
consistently through a single API, which would always use a mutex or never use
a mutex.

>  Looking at libstdc++ with objdump, I do see quite a few
> occurrences of lwarx even though _GLIBCXX_ATOMIC_BUILTINS is undefined.  These
> are the functions:
> 
> atomic_flag_test_and_set_explicit
> _ZL33__gxx_dependent_exception_cleanup19_Unwind_Reason_CodeP17_Unwind_Exception
> _ZNSt15__exception_ptr13exception_ptr9_M_addrefEv
> _ZNSt15__exception_ptr13exception_ptr10_M_releaseEv
> _ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE
> _ZL22free_any_cxa_exceptionP17_Unwind_Exception
> _ZL23__gxx_exception_cleanup19_Unwind_Reason_CodeP17_Unwind_Exception
> __cxa_guard_acquire
> __cxa_guard_abort
> __cxa_guard_release

That looks correct, none of those depends on _GLIBCXX_ATOMIC_BUILTINS

Could the problem be the initialization of the function-local static, rather
than in locking it later. That initialization should be thread-safe, that's
what __cxa_guard_acquire and __cxa_guard_release are used for:
http://sourcery.mentor.com/public/cxx-abi/abi.html#once-ctor


  parent reply	other threads:[~2012-04-05 13:03 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03  2:01 [Bug libstdc++/52839] New: " amodra at gmail dot com
2012-04-03  8:30 ` [Bug libstdc++/52839] " redi at gcc dot gnu.org
2012-04-03  9:19 ` redi at gcc dot gnu.org
2012-04-03 21:34 ` redi at gcc dot gnu.org
2012-04-04  0:20 ` redi at gcc dot gnu.org
2012-04-04  1:12 ` amodra at gmail dot com
2012-04-04  8:31 ` redi at gcc dot gnu.org
2012-04-04  9:58 ` amodra at gmail dot com
2012-04-04 10:39 ` redi at gcc dot gnu.org
2012-04-04 11:13 ` amodra at gmail dot com
2012-04-04 14:21 ` amodra at gmail dot com
2012-04-04 20:23 ` redi at gcc dot gnu.org
2012-04-04 22:28 ` amodra at gmail dot com
2012-04-04 23:03 ` amodra at gmail dot com
2012-04-05  4:00 ` amodra at gmail dot com
2012-04-05  8:07 ` amodra at gmail dot com
2012-04-05  8:10 ` redi at gcc dot gnu.org
2012-04-05 12:05 ` amodra at gmail dot com
2012-04-05 13:03 ` redi at gcc dot gnu.org [this message]
2012-04-10 15:14 ` amodra at gmail dot com
2012-04-10 15:36 ` redi at gcc dot gnu.org
2012-04-10 15:59 ` redi at gcc dot gnu.org
2012-04-10 23:53 ` amodra at gmail dot com
2012-04-11  0:31 ` redi at gcc dot gnu.org
2012-04-11  0:59 ` redi at gcc dot gnu.org
2012-04-12  8:25 ` torvald at gcc dot gnu.org
2012-04-12  8:31 ` redi at gcc dot gnu.org
2012-04-12  9:19 ` amodra at gmail dot com
2012-04-12 10:06 ` redi at gcc dot gnu.org
2012-04-12 10:10 ` redi at gcc dot gnu.org
2012-04-13 20:52 ` [Bug libstdc++/52839] [4.7/4.8 Regression] " redi at gcc dot gnu.org
2012-04-14 13:25 ` amodra at gcc dot gnu.org
2012-04-21 13:30 ` amodra at gcc dot gnu.org
2012-04-21 13:35 ` amodra at gcc dot gnu.org
2012-04-21 13:38 ` amodra at gmail dot com
2012-11-02  1:36 ` pinskia at gcc dot gnu.org
2012-11-02  2:13 ` amodra at gmail dot com
2012-11-02  2:17 ` pinskia at gcc dot gnu.org
2012-11-02  2:39 ` amodra at gmail dot com
2012-11-02  2:41 ` pinskia 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-52839-4-yRMjDM6i3M@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).