From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10922 invoked by alias); 20 Nov 2001 06:53:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10879 invoked from network); 20 Nov 2001 06:53:38 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sourceware.cygnus.com with SMTP; 20 Nov 2001 06:53:38 -0000 Received: from cse.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id WAA17326; Mon, 19 Nov 2001 22:53:33 -0800 (PST) Received: (from kev@localhost) by cse.cygnus.com (8.9.3/8.9.3) id XAA17496; Mon, 19 Nov 2001 23:53:19 -0700 Date: Wed, 07 Nov 2001 22:45:00 -0000 From: Kevin Buettner Message-Id: <1011120065319.ZM17495@ocotillo.lan> In-Reply-To: "H . J . Lu" "Re: [PATCH RFA] lin-lwp.c: Block SIGCHLD events when attaching" (Nov 19, 6:51pm) References: <1011119193045.ZM16376@ocotillo.lan> <20011119113832.A8778@lucon.org> <1011120004229.ZM17105@ocotillo.lan> <1011120022446.ZM17248@ocotillo.lan> <20011119185132.A16148@lucon.org> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: "H . J . Lu" Subject: Re: [PATCH RFA] lin-lwp.c: Block SIGCHLD events when attaching Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2001-11/txt/msg00142.txt.bz2 On Nov 19, 6:51pm, H . J . Lu wrote: > > > > # gcc -g ex11.c -lpthread -lrt -D_GNU_SOURCE -static > > > > # a.out > > > > # gdb a.out > > > > ... > > > > (gdb) att 14226 > > > > Attaching to program: /home/hjl/bugs/gdb/thread/a.out, process 14226 > > > > ... > > > > lin-lwp.c:620: gdb-internal-error: stop_wait_callback: Assertion `pid == GET_LWP (lp->ptid)' failed. > > > > An internal GDB error was detected. This may make further > > > > > > > > ex11.c is from glibc and 14226 is the first thread. Your patch may fix > > > > it also. > > > > > > I think this might be a different problem. I haven't been able to > > > reproduce the exact problem that you mentioned above, either with > > > or without my patch. > > > > > > I do occassionally see "Cannot find new threads: generic error". I'm > > > going to try to figure this one out... > > > > The "Cannot find new threads: generic error" that I'm seeing in this > > program is happening because td_ta_thr_iter() in libthread_db.so is > > requesting that gdb read the memory associated with a struct > > _pthread_descr_struct (which has size 1056). It turns out that gdb > > is able to read 1024 bytes of this struct, but no more. (ptrace() > > returns EIO when attempting to read more.) > > > > I'm not sure why this is happening. Could it be that the manager thread > > is in the midst of updating the descriptor data structures? > > Can you try gdb 5.1 to see what happens with ex11.c? I just tried it. It seems to behave about the same. It usually attaches okay, but I am able to reproduce the "Cannot find new threads: generic error" by using Jim's trick of repeatedly attaching and detaching. Kevin