From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17859 invoked by alias); 5 Apr 2012 12:05:20 -0000 Received: (qmail 17840 invoked by uid 22791); 5 Apr 2012 12:05:18 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 12:05:05 +0000 From: "amodra at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/52839] double free or corruption running tr1/.../default_weaktoshared.exe Date: Thu, 05 Apr 2012 12:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amodra at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00354.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52839 --- Comment #17 from Alan Modra 2012-04-05 12:05:01 UTC --- I spent quite a bit of time today looking at libpthread and can't spot a problem in pthread_mutex_lock and pthread_mutex_unlock. 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. 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