Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	gdb-patches@sourceware.org,
	Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [PATCH] fix spurious FAIL in py-inferior.exp (x86-solaris)
Date: Mon, 07 Mar 2011 10:52:00 -0000	[thread overview]
Message-ID: <201103071045.34737.pedro@codesourcery.com> (raw)
In-Reply-To: <20110307050445.GA31964@host1.jankratochvil.net>

On Monday 07 March 2011 05:04:45, Jan Kratochvil wrote:
> I do not have a fix but there seems to me mistaken LWP<->PID, each thread gets
> duplicated once as {PID, 0, ID} and once as {PID, ID, 0}.
> 
> (gdb) info threads 
>   Id   Target Id         Frame 
>   10   Thread 4 (LWP 4)  start3 (arg=0x0) at threadit.c:9
>   9    Thread 3 (LWP 3)  start2 (arg=0x0) at threadit.c:8
>   8    Thread 2 (LWP 2)  start1 (arg=0x0) at threadit.c:7
> * 7    Thread 5 (LWP 5)  start4 (arg=0x0) at threadit.c:10
>   6    LWP    5          start4 (arg=0x0) at threadit.c:10
>   5    LWP    4          start3 (arg=0x0) at threadit.c:9
>   4    LWP    3          start2 (arg=0x0) at threadit.c:8
>   3    LWP    2          start1 (arg=0x0) at threadit.c:7
>   2    Thread 1 (LWP 1)  0xfef022f5 in __lwp_wait () from /lib/libc.so.1
>   1    LWP    1          0xfef022f5 in __lwp_wait () from /lib/libc.so.1

It's not a simple "mistake".  Notice how the ids of LWPs are
aligned to the ids of threads.  This was not a coincidence, it
was done on purpose.  This was how solaris thread support
always behaved, up until the pthreads support got completely
broken circa gdb 6.3 and then I restored it a couple of years
ago (see "Modernize solaris threads support" thread).

From Solaris 2 to 8, the default user thread library
used an M:N model.  On v8 a 1:1 implementation appeared,
but it was not made the default (you can select it
at link time).  Solaris 9 switched to 1:1 completely.

Ref: <http://wwws.sun.com/software/whitepapers/solaris9/multithread.pdf>

The original author seems to have thought best to
just always expose everything.  I don't know what's
the use case that gets broken if we don't expose
lwps when the threading library is active.  Maybe
something around inactive threads.  Most likely nothing.

-- 
Pedro Alves


  reply	other threads:[~2011-03-07 10:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04 11:31 Joel Brobecker
2011-03-04 12:18 ` Mark Kettenis
2011-03-04 12:27   ` Pedro Alves
2011-03-07  5:05     ` Joel Brobecker
2011-03-07  5:21       ` Jan Kratochvil
2011-03-07 10:52         ` Pedro Alves [this message]
2011-03-07  9:49       ` Mark Kettenis
2011-03-07 10:16         ` Joel Brobecker
2011-03-07 11:02         ` Pedro Alves

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=201103071045.34737.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    /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