From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23297 invoked by alias); 21 Sep 2011 16:46:50 -0000 Received: (qmail 23285 invoked by uid 22791); 21 Sep 2011 16:46:46 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Sep 2011 16:46:28 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R6PwJ-0007fK-Of from pedro_alves@mentor.com ; Wed, 21 Sep 2011 09:46:27 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 21 Sep 2011 17:46:25 +0100 From: Pedro Alves To: "Burkhardt, Glenn" Subject: Re: fail to attach to process on Solaris Date: Wed, 21 Sep 2011 16:46:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: gdb@sourceware.org References: <201109211526.15713.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201109211746.23961.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00085.txt.bz2 On Wednesday 21 September 2011 17:18:25, Burkhardt, Glenn wrote: > Thank you very much for your response. > > I did peek at /proc from the command line when the breakpoint in > find_procinfo_or_die() was hit - there was no corresponding LWP. Nor, > does it seem, that any LWP with the same thread number ever existed. > > Here's more extensive info, with a complete stack trace, and some > preliminary info printed after gdb attaches. This time, the thread > number that triggered the problem was 65. Okay. I assume your program isn't spawning and exiting threads quickly in succession, otherwise, we'd see LWP ids much higher. It's libthread_db.so that maps a thread to a LWP id, so we may be missing some state checks and getting back a stale id. Try the "maint info sol-threads" command (I never noticed this command before), and let's see what state does libthread_db.so think the thread is in. I see that linux-thread-db.c (the glibc/linux fork of this code) has extra checks for ignoring threads in some states that the Solaris code doesn't have. Please don't top post. That has a tendency of making one forget to answer questions. :-) Here it is again: > This is Solaris 9, with the default 1:1 model thread library, right? -- Pedro Alves