Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFA/RFC] Don't use lwp_from_thread() in thread_db_wait()
Date: Mon, 11 Mar 2002 18:47:00 -0000	[thread overview]
Message-ID: <20020311214703.A462@nevyn.them.org> (raw)
In-Reply-To: <1020311234554.ZM20650@localhost.localdomain>

On Mon, Mar 11, 2002 at 04:45:54PM -0700, Kevin Buettner wrote:
> I'm seeing the following failure when I run the gdb testsuite on an
> SMP machine (GNU/Linux/x86):
> 
> FAIL: gdb.threads/pthreads.exp: continue to bkpt at common_routine in thread 2

Thank you for investigating this!  I've been seeing it somewhat
erratically for months, but not had any idea where to start.

> thread_db_wait() wants to learn the lwp id of the thread that it
> should wait for so that it can ask the lwp layer to wait on the lwp
> corresponding to the thread in question.  In order to do this, it
> calls lwp_from_thread().  lwp_from_thread needs help from the
> libthread_db.so to figure this out, so it calls td_ta_map_id2thr(). 
> BUT, this libthread_db function must interrogate the inferior
> process's memory to look at the thread data structures.  To do this,
> it calls back into gdb, using ps_pdread() to fetch the memory in
> question.  Eventually, on Linux, ptrace() gets called to actually
> fetch the memory.

There's another solution that I see.  At the top of thread-db is the
comment:

/* FIXME: There is certainly some room for improvements:
   - Cache LWP ids.

This would be a tremendous performance win, and fix this problem.  But
that may be a slightly longer term solution.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-03-12  2:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11 15:46 Kevin Buettner
2002-03-11 18:47 ` Daniel Jacobowitz [this message]
2002-03-11 19:16   ` Kevin Buettner
2002-03-11 19:23     ` Daniel Jacobowitz
2002-03-11 23:52       ` Kevin Buettner
2002-03-12  8:23         ` Daniel Jacobowitz
2002-03-13  9:37           ` David Taylor
2002-03-13  9:55             ` Daniel Jacobowitz
2002-03-13 10:18               ` Andrew Cagney
2002-03-13 10:38               ` David Taylor
2002-04-02 13:19 ` Daniel Jacobowitz
2002-05-02 14:07   ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020311214703.A462@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox