May 02, 2016

On 01.05.2016 23:54, Joakim wrote:
> On Sunday, 1 May 2016 at 08:01:42 UTC, Rainer Schuetze wrote:
>>
>>> I just noticed that the std.datetime problem disappears when disabling
>>> the garbage collection. My guess is that TLS is not scanned correctly.
>>>
>>
>> I think I have figured this out: TLS of the main thread is scanned
>> misaligned if the size of TLS is not a multiple of the pointer size:
>> https://github.com/ldc-developers/druntime/commit/740c1bb86b36725cf2d671a7ac8f77de692899be
>>
>
> Yeah, that fixes the phobos tests for me, guess it should be uncommented
> in getTLSRange below,

Please note that the versioned code in getTLSRange aligns to 2*size_t.sizeof which seems to relate to something else. Actually I added the alignment there first, but it triggered assertions elsewhere which would have to be adjusted, too. Aligning the stored size was the smallest change.

> still two unrelated failures in the dmd test
> suite.  I don't know how using druntime from the beta1 binary release
> didn't show this issue though.

It very much depends on the size and alignment of the last element in the TLS section. The order of symbol placement probably depends on order of object files in library, order of command line arguments, symbol dependencies and more, so pretty hard to predict.
May 02, 2016
On Monday, 2 May 2016 at 07:08:13 UTC, Rainer Schuetze wrote:
>
>
> On 01.05.2016 23:54, Joakim wrote:
>> [...]
>
> Please note that the versioned code in getTLSRange aligns to 2*size_t.sizeof which seems to relate to something else. Actually I added the alignment there first, but it triggered assertions elsewhere which would have to be adjusted, too. Aligning the stored size was the smallest change.

Yeah, ran into those when I tried it: I simply copied and pasted the adjustment before the assertion too.

>> [...]
>
> It very much depends on the size and alignment of the last element in the TLS section. The order of symbol placement probably depends on order of object files in library, order of command line arguments, symbol dependencies and more, so pretty hard to predict.

OK, good to know, thanks for fixing it.
1 2
Next ›   Last »