[Bug d/88462] All D execution tests FAIL on Solaris/SPARC
ro at CeBiTec dot Uni-Bielefeld.DE
gcc-bugzilla@gcc.gnu.org
Thu Dec 13 14:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88462
--- Comment #5 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #4 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
> Stepping through the backtrace, I see the following at Thread.initLocks
> (core/thread.d around line 1719).
[...]
> So there are two things. Firstly, the object instance is type punned from a
> void[N] array. Secondly it is aligned to pointer size, not the alignment of
> the underlying record type.
>
> So I'm certain that the problem will be fixed if `align(Mutex.alignof)` is
> replaced with `align(8)`.
Unfortunately, this doesn't work: the first time through, _locks[0] was
already 8-byte aligned and everything worked fine. This remained when
using align(8) instead. However, Mutex is 44 bytes on 32-bit
Solaris/x86, so again _locks[1] lands on a non-8 byte boundary and
pthread_mutex_init fails.
I tried rouding up the size of the _locks array members to a multiple of
8, but that let the constructor already fail the first time through
where _d_arraycopy checks that the right amount of data is copied:
_d_arraycopy -> rt.util.array.enforceRawArraysConformable ->
rt.util.array._enforceSameLength
More information about the Gcc-bugs
mailing list