From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 896AC396ECAC; Thu, 7 Jan 2021 16:27:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 896AC396ECAC From: "ro at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/98584] New: Many D tests FAIL with SIGBUS in read_encoded_value_with_base Date: Thu, 07 Jan 2021 16:27:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: d X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ro at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw at gdcproject dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2021 16:27:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98584 Bug ID: 98584 Summary: Many D tests FAIL with SIGBUS in read_encoded_value_with_base Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: ro at gcc dot gnu.org Target Milestone: --- Target: sparc-sun-solaris2.11 Inspired by the recent patch to enable libphobos with Solaris/x86 as, I tri= ed the same on Solaris/SPARC (where libphobos is not yet enabled by default even w= ith gas, but I've some success doing so anyway). However, when using as instead of gas, many tests FAIL with SIGBUS, e.g. FAIL: gdc.dg/torture/gdc17.d -O0 execution test Thread 2 received signal SIGBUS, Bus error. [Switching to Thread 1 (LWP 1)] gcc.unwind.pe.read_encoded_value_with_base(ubyte, uint, const(ubyte)**) (encoding=3D, base=3D0, p=3D0xffbfdb8c) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/unwind/pe.d:200 200 result =3D cast(_Unwind_Internal_Ptr) *cast(int*)q; (gdb) where #0 gcc.unwind.pe.read_encoded_value_with_base(ubyte, uint, const(ubyte)**) (encoding=3D, base=3D0, p=3D0xffbfdb8c) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/unwind/pe.d:200 #1 0x0005e258 in gcc.deh.scanLSDA(const(ubyte)*, ulong, int, gcc.unwind.generic._Unwind_Exception*, gcc.unwind.generic._Unwind_Context*, uint, out uint, out int) (lsda=3D0xcbd2c "\377", exceptionClass=3D, actions=3D1, unwindHeader=3D0xff040220, context=3D0xffbfdecc, cfa=3D4290766= 520, landingPad=3D@0xffbfdc0c: 0, handler=3D@0xffbfdc14: 0) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/deh.d:634 #2 0x0005e508 in gcc.deh.__gdc_personality(int, ulong, gcc.unwind.generic._Unwind_Exception*, gcc.unwind.generic._Unwind_Context*) (actions=3D1, exceptionClass=3D5138137972268335104, unwindHeader=3D0xff0402= 20, context=3D0xffbfdecc) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/deh.d:917 #3 0xff07c4f8 in _Unwind_RaiseException (exc=3D0xff040220) at /builds2/ulhg/nightly_87/components/gcc10/gcc-10.2.0/libgcc/unwind.inc:118 #4 0x0005def4 in _d_throw (object=3D0xfef32000) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/deh.d:509 #5 0x000656d0 in onAssertError (file=3D..., line=3D12) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/exception.d:441 #6 0x00065c18 in _d_assert (file=3D..., line=3D12) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/exception.d:641 #7 0x0005d1ac in gdc17.contractTest(immutable(char)[]) (path=3D...) at /vol/gcc/src/hg/master/local/gcc/testsuite/gdc.dg/torture/gdc17.d:12 #8 0x0005d2cc in gdc17.ModuleSaver.save(immutable(char)[]).__require() (this=3D0xffbfe728) at /vol/gcc/src/hg/master/local/gcc/testsuite/gdc.dg/torture/gdc17.d:21 #9 0x0005d330 in gdc17.ModuleWriter.save(immutable(char)[]) (this=3D0xfef3= 1000, str=3D...) at /vol/gcc/src/hg/master/local/gcc/testsuite/gdc.dg/torture/gdc17.d:27 #10 0x0005d044 in D main () at /vol/gcc/src/hg/master/local/gcc/testsuite/gdc.dg/torture/gdc17.d:36 (gdb) p p $1 =3D (const ubyte **) 0xffbfdc04 (gdb) p/x p $2 =3D 0xffbfdc04 (gdb) p/x *p $3 =3D 0xcbd31 SPARC being a strict-alignment target, one cannot dereference an odd point as int *. #1 0x0005e258 in gcc.deh.scanLSDA(const(ubyte)*, ulong, int, gcc.unwind.generic._Unwind_Exception*, gcc.unwind.generic._Unwind_Context*, uint, out uint, out int) (lsda=3D0xcbd2c "\377", exceptionClass=3D, actions=3D1, unwindHeader=3D0xff040220, context=3D0xffbfdf44, cfa=3D4290766= 640, landingPad=3D@0xffbfdc84: 0, handler=3D@0xffbfdc8c: 0) at /vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/deh.d:634 634 auto CSStart =3D read_encoded_value(null, CSEncoding, &= p); (gdb) p p $4 =3D (const ubyte *) 0xcbd31 "" Replacing gdc17.o from the gas build lets the test PASS. I have not yet determine where/how exactly the objects differ to cause this failure. However, comparing pe.d (read_encoded_value_with_base) with libgcc's unwind-pe.h, I find that the latter accounts for strict-alignment targets by using an union unaligned for the access instead of just casting.=