From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31636 invoked by alias); 21 Sep 2011 18:45:22 -0000 Received: (qmail 31627 invoked by uid 22791); 21 Sep 2011 18:45:20 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from phx-mxvgateway.goodrich.com (HELO phx-mxv1gateway.goodrich.com) (63.241.174.110) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Sep 2011 18:45:07 +0000 Received: from GR-GWI-WEST-A.goodrich.com (gr-gwi-west-a.goodrich.com [170.126.245.4]) by phx-mxv1gateway.goodrich.com (Symantec Messaging Gateway) with SMTP id D0.96.25480.2B03A7E4; Wed, 21 Sep 2011 14:45:06 -0400 (EDT) Received: from nhc0ex21.goodrich.root.local ([170.126.245.60]) by GR-GWI-WEST-A.goodrich.com (8.13.5/8.13.5) with ESMTP id p8LIj2n7019231; Wed, 21 Sep 2011 14:45:03 -0400 (EDT) Received: from nhc0ex17.goodrich.root.local ([170.126.246.106]) by nhc0ex21.goodrich.root.local with Microsoft SMTPSVC(6.0.3790.4675); Wed, 21 Sep 2011 11:45:01 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: fail to attach to process on Solaris Date: Wed, 21 Sep 2011 18:45:00 -0000 Message-ID: In-Reply-To: <201109211839.28701.pedro@codesourcery.com> References: <201109211746.23961.pedro@codesourcery.com> <201109211839.28701.pedro@codesourcery.com> From: "Burkhardt, Glenn" To: "Pedro Alves" Cc: 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/msg00089.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:pedro@codesourcery.com]=20 > Sent: Wednesday, September 21, 2011 1:39 PM > To: Burkhardt, Glenn > Cc: gdb@sourceware.org > Subject: Re: fail to attach to process on Solaris >=20 >=20 > Okay, the linux code ignores zombie threads, like in the=20 > patch below. Does that help? There's a couple more places=20 > where it ignores zombie threads, that we may need to bring=20 > over as well. > Look for TD_THR_ZOMBIE in linux-thread-db.c. >=20 > -- > Pedro Alves >=20 > --- > gdb/sol-thread.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > Index: src/gdb/sol-thread.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- src.orig/gdb/sol-thread.c 2011-03-01 16:00:06.000000000 +0000 > +++ src/gdb/sol-thread.c 2011-09-21 18:34:30.029928904 +0100 > @@ -1177,6 +1177,9 @@ sol_find_new_threads_callback (const td_ > if (retval !=3D TD_OK) > return -1; >=20=20 > + if (ti.ti_state =3D=3D TD_THR_UNKNOWN || ti.ti_state =3D=3D TD_THR_ZOM= BIE) > + return 0; /* A zombie -- ignore. */ > + > ptid =3D BUILD_THREAD (ti.ti_tid, PIDGET (inferior_ptid)); > if (!in_thread_list (ptid) || is_exited (ptid)) > add_thread (ptid); >=20 The patch makes a big difference. At least, I can continue the attached process now. I'll play with it a bit more, and report back. I'll also check for other places where TD_THR_ZOMBIE in linux-thread-db.c is used.