From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16421 invoked by alias); 31 Jan 2012 01:04:22 -0000 Received: (qmail 16405 invoked by uid 22791); 31 Jan 2012 01:04:20 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Tue, 31 Jan 2012 01:04:07 +0000 From: "howarth at nitro dot med.uc.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/51906] thread lock test failures on darwin11 under Xcode 4.2 Date: Tue, 31 Jan 2012 02:26: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: howarth at nitro dot med.uc.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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" Content-Transfer-Encoding: quoted-printable 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-01/txt/msg03608.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D51906 --- Comment #25 from Jack Howarth 2012-01= -31 01:03:33 UTC --- (In reply to comment #24) Here is a trace for libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc compiled at -O0 with... /sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/./gcc/g++ -shared-libgcc -B/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/./gcc -nostdinc++ -L/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/= libstdc++-v3/src -L/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/= libstdc++-v3/src/.libs -B/sw/lib/gcc4.7/x86_64-apple-darwin11.2.0/bin/ -B/sw/lib/gcc4.7/x86_64-apple-darwin11.2.0/lib/ -isystem /sw/lib/gcc4.7/x86_64-apple-darwin11.2.0/include -isystem /sw/lib/gcc4.7/x86_64-apple-darwin11.2.0/sys-include -B/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/= ./libstdc++-v3/src/.libs -D_GLIBCXX_ASSERT -fmessage-length=3D0 -ffunction-sections -fdata-sections = -g -O0 -DLOCALEDIR=3D"." -nostdinc++ -I/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/= libstdc++-v3/include/x86_64-apple-darwin11.2.0 -I/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/= libstdc++-v3/include -I/sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/libsupc++ -I/sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/include/ba= ckward -I/sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/testsuite/= util /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/testsuite/30= _threads/recursive_mutex/try_lock/1.cc -std=3Dgnu++0x ./libtestc++.a -L/sw/lib -liconv -lm -m64 -o ./1.exe The resulting binary fails with the same error as when compiled with -O2 but now traces as... (gdb) break main Breakpoint 1 at 0x100000b8e: file /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/testsuite/30= _threads/recursive_mutex/try_lock/1.cc, line 32. (gdb) r Starting program: /sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/x86_64-apple-darwin11.2.0/li= bstdc++-v3/testsuite/1.exe=20 Reading symbols for shared libraries ++++........................ done Breakpoint 1, main () at /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/testsuite/30= _threads/recursive_mutex/try_lock/1.cc:32 32 bool test __attribute__((unused)) =3D true; (gdb) s 37 mutex_type m; (gdb)=20 38 bool b =3D m.try_lock(); (gdb)=20 std::recursive_mutex::try_lock (this=3D0x7fff5fbff770) at mutex:221 221 return !__gthread_recursive_mutex_trylock(&_M_mutex); (gdb)=20 __gthread_recursive_mutex_trylock (__mutex=3D0x7fff5fbff770) at x86_64-apple-darwin11.2.0/bits/gthr-default.h:813 813 return __gthread_mutex_trylock (__mutex); (gdb)=20 __gthread_mutex_trylock (__mutex=3D0x7fff5fbff770) at x86_64-apple-darwin11.2.0/bits/gthr-default.h:754 754 if (__gthread_active_p ()) (gdb)=20 __gthread_active_p () at x86_64-apple-darwin11.2.0/bits/gthr-default.h:306 306 return 1; (gdb)=20 307 } (gdb)=20 __gthread_mutex_trylock (__mutex=3D0x7fff5fbff770) at x86_64-apple-darwin11.2.0/bits/gthr-default.h:755 755 return __gthrw_(pthread_mutex_trylock) (__mutex); (gdb)=20 758 } (gdb)=20 __gthread_recursive_mutex_trylock (__mutex=3D0x7fff5fbff770) at x86_64-apple-darwin11.2.0/bits/gthr-default.h:814 814 } (gdb)=20 std::recursive_mutex::try_lock (this=3D0x7fff5fbff770) at mutex:222 222 } (gdb)=20 main () at /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/testsuite/30= _threads/recursive_mutex/try_lock/1.cc:39 39 VERIFY( b ); (gdb)=20 Assertion failed: (b), function main, file /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120126/libstdc++-v3/testsuite/30= _threads/recursive_mutex/try_lock/1.cc, line 39. Program received signal SIGABRT, Aborted. 0x00007fff927c182a in __kill () (gdb)=20 Also, I still can't get your test program to compile with gcc 4.7 or Apple gcc-4,2, FSF gcc 4.7 errors with... pthread_test.c:4:22: error: expected =E2=80=98:=E2=80=99, =E2=80=98,=E2=80= =99, =E2=80=98;=E2=80=99, =E2=80=98}=E2=80=99 or =E2=80=98__attribute__=E2= =80=99 before =E2=80=98=3D=E2=80=99 token pthread_test.c: In function =E2=80=98main=E2=80=99: pthread_test.c:9:3: error: unknown type name =E2=80=98mutex=E2=80=99 pthread_test.c:10:34: error: request for member =E2=80=98m=E2=80=99 in some= thing not a structure or union and Apple gcc-4.2 errors with... pthread_test.c:4: error: expected =E2=80=98:=E2=80=99, =E2=80=98,=E2=80=99,= =E2=80=98;=E2=80=99, =E2=80=98}=E2=80=99 or =E2=80=98__attribute__=E2=80= =99 before =E2=80=98=3D=E2=80=99 token pthread_test.c: In function =E2=80=98main=E2=80=99: pthread_test.c:9: error: =E2=80=98mutex=E2=80=99 undeclared (first use in t= his function) pthread_test.c:9: error: (Each undeclared identifier is reported only once pthread_test.c:9: error: for each function it appears in.) pthread_test.c:9: error: expected =E2=80=98;=E2=80=99 before =E2=80=98m=E2= =80=99 pthread_test.c:10: error: =E2=80=98m=E2=80=99 undeclared (first use in this= function)