This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Go patch committed: Multiplex goroutines onto OS threads


Ian Lance Taylor <iant@google.com> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>>   All tests hang with the default -test.timeout=240.
>
> Thanks for providing access to a Solaris system.
>
> Right now it looks like there is a bug, or at least an incompatibility,
> in the 64-bit versions of getcontext and setcontext.  It looks like
> calling setcontext on the 32-bit version does not change the value of
> TLS variables, which is also the case on GNU/Linux.  In the 64-bit
> version, calling setcontext does change the value of TLS variables.
> That is, on the 64-bit version, getcontext preserves the value of TLS
> variables and setcontext restores the old value.  (Of course it's really
> the pointer, not the TLS variables themselves).  This incompatibility
> has to be a bug, and of course I would prefer that the incompatibility
> be resolved in favor of the implementation used on GNU/Linux.
>
> Here is a program which shows the issue.  Compile with -pthread.  With
> -m32 it prints go1: tls == 2.  With -m64 it prints go1: tls == 1.  The
> program is too complex for the problem, but it does show the issue.

Thanks for the detective work.  I'll try to find in the OpenSolaris
sources what's going on, at the same time contacting the Solaris
engineers about the issue.

There's more to the problem, though: on Solaris/SPARC (mayon is a
Solaris 11 machine you could use here), both 32 and 64-bit versions of
the test program print tls == 2, but many (not all) libgo tests still
fail.

I also tried the program on IRIX 6.5 (columba, dog slow unfortunately),
which doesn't have native TLS.  It doesn't go beyond the

go1: tls == 2

line, and I had to reduce the stack sizes to 32 MB to allow it to run at
all.  On Tru64 UNIX (haydn), also using emutls, it does run until the

i == 0

line, but doesn't finish.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]