Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Vinay Sridhar <vinay@linux.vnet.ibm.com>
Cc: Pedro Alves <pedro@codesourcery.com>,
	gdb-patches@sourceware.org, 	luisgpm@linux.vnet.ibm.com
Subject: Re: [RFC][Patch] Fix gdb failure to access tls data for parent 	thread
Date: Tue, 24 Feb 2009 17:16:00 -0000	[thread overview]
Message-ID: <20090224153153.GA7032@caradoc.them.org> (raw)
In-Reply-To: <1235472610.4894.14.camel@localhost.localdomain>

On Tue, Feb 24, 2009 at 04:20:10PM +0530, Vinay Sridhar wrote:
> Please try this test and let me know if you're able to get a recreate:

I can reproduce this.  Here's where we ought to discover the thread:

1012      /* Iterate over all user-space threads to discover new threads.  */
1013      err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
1014                              TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
1015                              TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);

The first two times this is called, ti_tid is 0 for the main thread,
so we do nothing.  The third time, find_new_threads_callback
is never called!  The thread library is claiming we have no threads.
Repeating "info threads" again has the same effect:

  5 Thread 0x7ffff5c5f950 (LWP 7440)  0x00007ffff7bde9c7 in ?? () from
  /usr/lib/libgomp.so.1
  4 Thread 0x7ffff6460950 (LWP 7439)  initTlsData () at omp-test.c:9
  3 Thread 0x7ffff6c61950 (LWP 7438)  0x00007ffff7bdea1a in ?? () from
  /usr/lib/libgomp.so.1
  2 Thread 0x7ffff7462950 (LWP 7418)  0x00007ffff7bdea1a in ?? () from
  /usr/lib/libgomp.so.1
* 1 LWP 7410  0x00007ffff7bdea1a in ?? () from /usr/lib/libgomp.so.1

Pedro, unfortunately this bug is related to non-stop :-(

81            /* Verify that this thread's pid field matches the child PID.
82               If its pid field is negative, it's about to do a fork or it
83               is the sole thread in a fork child.  */

It's checking that the PID (not TID) matches proc_handle.pid.  We need
to find another way to read from a stopped thread, since if we put any
other PID there, we get no threads.  I would suggest expanding
ps_prochandle to include a memory thread as ptid_t.  We always try to
read from the most recently added stopped thread, since the lwp_list
gets additions at the front.

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2009-02-24 15:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09  8:47 Vinay Sridhar
2009-02-04 13:29 ` Daniel Jacobowitz
2009-02-11  8:33   ` Vinay Sridhar
2009-02-11 15:53     ` Daniel Jacobowitz
2009-02-12  5:45       ` Vinay Sridhar
2009-02-16  3:19         ` Daniel Jacobowitz
2009-02-16 15:04           ` Vinay Sridhar
2009-02-16 15:20             ` Daniel Jacobowitz
2009-02-17  7:01               ` Vinay Sridhar
2009-02-17 16:20                 ` Daniel Jacobowitz
2009-02-20  8:31                   ` Vinay Sridhar
2009-02-23  0:17                     ` Daniel Jacobowitz
2009-02-23  9:20                       ` Vinay Sridhar
2009-02-23 16:10                         ` Daniel Jacobowitz
2009-02-24  7:11                           ` Pedro Alves
2009-02-24 13:33                             ` Vinay Sridhar
2009-02-24 13:39                               ` Vinay Sridhar
2009-02-24 17:16                               ` Daniel Jacobowitz [this message]
2009-02-24 18:52                                 ` Pedro Alves
2009-02-24 18:58                                   ` Pedro Alves
2009-02-25 18:28                                     ` Vinay Sridhar
2009-02-27 21:49                                       ` Pedro Alves
2009-02-24 10:57                           ` Vinay Sridhar

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=20090224153153.GA7032@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=luisgpm@linux.vnet.ibm.com \
    --cc=pedro@codesourcery.com \
    --cc=vinay@linux.vnet.ibm.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