Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Feb 2010 15:22:19 -0800
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: TLS(and by extension all threading) completely broken in Valgrind on   i386/amd64
Message-ID:  <20100226152219.cbaae890.stas@FreeBSD.org>
In-Reply-To: <bc2d971002071106s53356f7p30696c9abc5f2795@mail.gmail.com>
References:  <bc2d971002071106s53356f7p30696c9abc5f2795@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 7 Feb 2010 14:06:18 -0500
Ryan Stone <rysto32@gmail.com> mentioned:

> I've been trying out valgrind on some threaded FreeBSD applications
> but they've been deadlocking at startup. =9AI've identified that the
> root cause is that FreeBSD's thread local storage is not being
> emulated properly by valgrind. =9AThe problem on amd64 is obvious:
> valgrind gives an invalid opcode error when the program tries to
> execute any instruction that accesses the gs register. =9AOn i386 the
> problem is much more subtle.
>=20
> I've attached two test applications that demonstrate the problem. =9AIn
> pthread_self.c, I create one thread which periodically prints
> pthread_self(), and then 10 seconds later I create a second thread.
> After the second thread is created, the first thread believes that it
> is the second thread. =9AHere's an example invocation:
>=20

Thank you a lot for the information, I'll try to look into this soon and
will followup in detail.

Sorry for delay in replying.

--=20
Stanislav Sedov
ST4096-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100226152219.cbaae890.stas>