[libphobos] Work around lack of dlpi_tls_modid before Solaris 11.5

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Feb 4 13:18:00 GMT 2019


Hi Johannes,

>> I suspect the two testsuite regressions (compared to a build with
>> dlpi_tls_modid present) I mentioned are exactly of the kind you mention:
>>
>> e.g. the gdc.test/runnable/testaa.d failures are like this
>>
>> core.exception.RangeError@gdc.test/runnable/testaa.d(410): Range violation
>> ----------------
>> /vol/gcc/src/hg/trunk/local/libphobos/libdruntime/core/exception.d:496
>> onRangeError [0x80f0d2c]
>> /vol/gcc/src/hg/trunk/local/libphobos/libdruntime/core/exception.d:672
>> _d_arraybounds [0x80f132f]
>> ??:? void testaa.test15() [0x80d7ae4]
>> ??:? _Dmain [0x80dd3fc]
>> before test 1
>>
>> and gdc.test/runnable/xtest55.d fails like so:
>>
>> core.exception.AssertError@gdc.test/runnable/xtest55.d(19): Assertion failure
>> ----------------
>> /vol/gcc/src/hg/trunk/local/libphobos/libdruntime/core/exception.d:441
>> onAssertError [0x7fff55dd3b56]
>> ??:? _Dmain [0x418959]
>> 7FFFBEB00000    7FFFBEB00000
>
> If you want to verify whether it's really a GC problem, you can add this in
> the main function to disable GC collections:
>
> import core.memory;
> GC.disable();

thanks for the hint.  With that change, the xtest55.d failure vanishes,
while the testaa.d one remains unchanged.

> This should be fine for the test suite. If you want to do this for the unit
> tests it's slightly more complicated as the main functions is executed
> _after_ all unit tests. IIRC adding it in a shared static this() module
> constructor would work there.

The unittest failures also occur when dlpi_tls_modid is present.

The libphobos testsuite regressions are like this:

+FAIL: libphobos.shared/link.d -I/vol/gcc/src/hg/trunk/local/libphobos/testsuite/libphobos.shared lib.so -shared-libphobos execution test

  64-bit only

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x00000000005064f0 in ?? ()
(gdb) where
#0  0x00000000005064f0 in ?? ()
#1  0x00007fff38903c84 in lib.tls_access() ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/lib.d:26
#2  0x000000000040298d in link.testGC() ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/link.d:24
#3  0x0000000000402e36 in D main ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/link.d:62

The rest occurs for both 32 and 64-bit:

+FAIL: libphobos.shared/link_linkdep.d -I/vol/gcc/src/hg/trunk/local/libphobos/testsuite/libphobos.shared liblinkdep.so lib.so -shared-libphobos execution test

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x080620ad in ?? ()
(gdb) where
#0  0x080620ad in ?? ()
#1  0xfe652f2e in lib.stack!(lib.tls_access()).stack() ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/lib.d:33
#2  0xfe6528fd in lib.testGC() ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/lib.d:45
#3  0xfe652af1 in lib.runTestsImpl() ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/lib.d:80
#4  0xfe652a1e in runTests ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/lib.d:62
#5  0xfe670be4 in runDepTests ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/liblinkdep.d:5
#6  0x08050efa in D main ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/link_linkdep.d:5

Except for the last one, the rest is similar:

+FAIL: libphobos.shared/load_linkdep.d -shared-libphobos -ldl execution test
+FAIL: libphobos.shared/load_loaddep.d -shared-libphobos -ldl execution test
+FAIL: libphobos.shared/linkDR.c -shared-libphobos -ldl -pthread execution test
+FAIL: libphobos.shared/host.c -ldl -pthread execution test
+FAIL: libphobos.shared/loadDR.c -ldl -pthread -g execution test

This one is a bit of the odd man out:

Thread 2 received signal SIGILL, Illegal instruction.
[Switching to Thread 1 (LWP 1)]
0x08061f85 in ?? ()
(gdb) where
#0  0x08061f85 in ?? ()
#1  0xfe4b2f2e in lib.stack!(lib.tls_access()).stack() ()
    at /vol/gcc/src/hg/trunk/solaris/libphobos/testsuite/libphobos.shared/lib.d:33
#2  0xe8fe4b28 in ?? ()
[...]
#63 0x00fe6ec9 in ?? ()
#64 0x00000000 in ?? ()

	Rainer

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



More information about the Gcc-patches mailing list