From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21324 invoked by alias); 16 Jul 2009 01:25:45 -0000 Received: (qmail 21316 invoked by uid 22791); 16 Jul 2009 01:25:44 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jul 2009 01:25:35 +0000 Received: from spaceape14.eur.corp.google.com (spaceape14.eur.corp.google.com [172.28.16.148]) by smtp-out.google.com with ESMTP id n6G1PX0N016132 for ; Wed, 15 Jul 2009 18:25:33 -0700 Received: from fxm4 (fxm4.prod.google.com [10.184.13.4]) by spaceape14.eur.corp.google.com with ESMTP id n6G1PUlV003263 for ; Wed, 15 Jul 2009 18:25:30 -0700 Received: by fxm4 with SMTP id 4so3449340fxm.20 for ; Wed, 15 Jul 2009 18:25:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.24.17 with SMTP id b17mr4523485muj.71.1247707530147; Wed, 15 Jul 2009 18:25:30 -0700 (PDT) In-Reply-To: <8ac60eac0906221321r45c43a13g87a830f8dd3487ea@mail.gmail.com> References: <20090605222214.66E2976BC4@localhost> <8ac60eac0906151139w23c6cc2ag9307d73232753f65@mail.gmail.com> <8ac60eac0906220910p5750f455u1e3dc462035d50b6@mail.gmail.com> <4A3FC8CA.5070700@vmware.com> <8ac60eac0906221321r45c43a13g87a830f8dd3487ea@mail.gmail.com> Date: Thu, 16 Jul 2009 02:42:00 -0000 Message-ID: Subject: Re: [patch] Fix for gdb.threads/staticthreads.exp failure on Linux From: Doug Evans To: Paul Pluzhnikov Cc: Michael Snyder , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00402.txt.bz2 On Mon, Jun 22, 2009 at 1:21 PM, Paul Pluzhnikov wr= ote: > On Mon, Jun 22, 2009 at 11:09 AM, Michael Snyder wrot= e: > >> Have you, or could you, run regression testing in i686? > > This is glibc-version related, rather than x86_64 vs. i686: > > Using glibc-2.7: "runtest gdb.threads/staticthreads.exp" gives: > > =A0# of expected passes =A0 =A0 =A0 =A0 =A0 =A08 > =A0# of known failures =A0 =A0 =A0 =A0 =A0 =A0 1 > > in both i686 and x86_64 modes. > > But using glibc-2.3.6 (which is my target): > > =A0FAIL: gdb.threads/staticthreads.exp: running to main in runto > =A0FAIL: gdb.threads/staticthreads.exp: Continue to main's call of sem_po= st > =A0FAIL: gdb.threads/staticthreads.exp: handle SIG32 helps > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D=3D=3D gdb Summary =3D=3D=3D > > =A0# of expected passes =A0 =A0 =A0 =A0 =A0 =A06 > =A0# of unexpected failures =A0 =A0 =A0 =A03 > =A0# of known failures =A0 =A0 =A0 =A0 =A0 =A0 1 > > again in both i686 and x86_64 modes. > > Thanks, > -- > Paul Pluzhnikov > I looked into this a bit. I think(!) this is the glibc patch that fixes things. 2007-05-16 Roland McGrath * td_ta_thr_iter.c (iterate_thread_list): Make FAKE_EMPTY bool. Use th_unique=3D0 in fake descriptor before initialization. Regardless, this is indeed glibc specific, and older glibcs fail while newer ones pass. I like the patch. If thread enumeration fails during try_thread_db_load_1 we ignore it and leave gdb to try again later. When we get to this point we've already verified libthread_db is (mostly) happy. I kinda wonder, though, if that works then maybe gdb shouldn't do thread enumeration at all here. Running the testcase with --target_board=3Dnative-gdbserver doesn't have this problem. Some research as to what gdbserver is doing would be illuminating. "consistency is good": can you research what's happening in gdbserver that it works there, and see if it's reasonable to do the same thing in gdb? [digression: GDB does use glibc's support for determining the glibc version, but here we want the glibc version of libthread_db so that's out. Hmmm, though it looks like the existing use of gnu_get_libc_version is to get the libthread_db version which can be different now that we have libthread-db-search-path. ... This seems like a problem, though in practice I suspect it's ok. [grep for gnu_get_libc_version in linux-thread-db.c]] I think a comment needs to be added to your patch, probably to the call site of thread_db_find_new_threads_silently, that thoroughly explains what's going on (assuming that's still the best solution). btw, the reason for the 1 known failure is, I'm guessing, because gdb was built with the same toolchain that uses the older glibc, but the test was run using a native toolchain that uses a newer glibc and the mismatch is sufficient to trigger the failure. At least that explains things in my sandbox. If I rebuild gdb with native gcc, or set libthread-db-search-path to find the newer glibc, the kfail goes away.