This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][ARM] Fix _dl_tlsdesc_resolve_hold to save r0
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 14 Oct 2015 16:04:27 +0100
- Subject: Re: [PATCH][ARM] Fix _dl_tlsdesc_resolve_hold to save r0
- Authentication-results: sourceware.org; auth=none
- References: <561E1E63 dot 3020404 at arm dot com> <alpine dot DEB dot 2 dot 10 dot 1510141216220 dot 611 at digraph dot polyomino dot org dot uk> <561E5DE3 dot 3080803 at arm dot com>
On Wed, Oct 14, 2015 at 2:51 PM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 14/10/15 13:17, Joseph Myers wrote:
>>
>> On Wed, 14 Oct 2015, Szabolcs Nagy wrote:
>>
>>> _dl_tlsdesc_resolve_hold calls into a C function that clobbers r0,
>>> but it assumes the original argument is still in r0 after the call.
>>> This can cause crash in case of concurrent TLS access when TLSDESC
>>> is in use (-mtls-dialect=gnu2).
>>
>>
>> I presume this issue was user-visible in a release, in which case a bug
>> should be filed in Bugzilla for it. Should I take it that it's hard to
>> write a testcase for this bug that fails reliably without the patch?
>>
>
> ok it's BZ 19129
>
> i have a test that triggers this or the other tlsdesc race
> i was about to fix, but it is a bit expensive.
>
> (666 tls objects accessed from 66 threads, 2 versions to
> get tlsdesc entries 8byte-unaligned, running 10x triggers
> the failure, a smaller test triggers less frequently.)
>
> i'm not sure what's the glibc policy for expensive tests.
>
> and i think -mtls-dialect=gnu2 is not available in all
> supported gcc versions.
Support for this appeared in FSF GCC 4.7
Ramana
>
> (the test makes sense on all archs where lazy tls
> initialization may be racy).
>