https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124157

            Bug ID: 124157
           Summary: [16 regression] gdc.dg/torture/pr96152.d etc. FAIL
           Product: gcc
           Version: 16.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

Between 20260204 (f845b6995580f7de03b43fef1ad864e3ae28d590) and 20260205
(216bda11307c98904db164e1db1f198ceea53db1), a large number of D tests (both in
gdc.test and libphobos) began to FAIL on 32-bit SPARC, e.g.

FAIL: gdc.dg/torture/pr96152.d   -O0  execution test

with all options.

gdc.log shows

Segmentation fault while running unittests:
----------------
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/runtime.d:592 extern
(C) void core.runtime.runModuleUnitTests().unittestSegvHandler(int,
core.sys.posix.signal.siginfo_t*, void*) [0xbf4c3]
??:? __sighndlr [0xfe7f57cb]
??:? const pure nothrow @property @nogc @safe uint
core.internal.newaa.Impl!(pr96152.__unittest_L20_C7().ThrowingElement,
int).Impl.length() [0x962bc]
??:? const pure nothrow @property @nogc @safe uint
core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA.length() [0x9648f]
??:? pure nothrow @nogc @safe bool
core.internal.newaa._aaEqual!(const(core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA), pr96152.__unittest_L20_C7().ThrowingElement, int)._aaEqual(scope
const(core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA), scope
const(core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA)) [0x95bdb]??:? pure nothrow @nogc @safe bool
core.internal.newaa._d_aaEqual!(pr96152.__unittest_L20_C7().ThrowingElement,
int)._d_aaEqual(scope const(int[pr96152.__unittest_L20_C7().ThrowingElement]),
scope const(int[pr96152.__unittest_L20_C7().ThrowingElement])) [0x93d53]
??:? @safe void pr96152.__unittest_L20_C7() [0x93a9f]
??:? void pr96152.__modtest() [0x96133]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/runtime.d:663
__foreachbody_L651_C5 [0xbf71f]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/object.d:2519
__lambda_L2519_C13 [0xadd13]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/minfo.d:592
__foreachbody_L585_C5 [0xa694f]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/sections/elf.d:106 int
gcc.sections.elf.DSO.opApply(scope int delegate(ref gcc.sections.elf.DSO))
[0x9a307]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/minfo.d:585 int
rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
[0xa7f23]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/object.d:2518 int
object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) [0xaf8a7]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/runtime.d:651
runModuleUnitTests [0xc077b]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:511 runAll
[0x98fc3]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:478 tryExec
[0x9926f]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:549 _d_run_main2
[0x9926f]
/vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:323 _d_run_main
[0x993cf]
??:? main [0x96273]
??:? _start [0x93683]

The message is wrong, however: running it manually prints

Bus Error

matching what gdb shows:

Thread 2 received signal SIGBUS, Bus error.
[Switching to Thread 1 (LWP 1)]
0x000961bc in
core.internal.newaa.Impl!(pr96152.__unittest_L20_C7().ThrowingElement,
int).Impl.length() const (this=...)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/newaa.d:272
272             assert(used >= deleted);

1: x/i $pc
=> 0x961bc
<_D4core8internal5newaa__T4ImplTS7pr9615217__unittest_L20_C7FNfZ15ThrowingElementTiZQCg6lengthMxFNaNbNdNiNfZk+12>:
  ld  [ %g1 + 8 ], %g2
(gdb) p/x $g1
$1 = 0x2

  core.internal.newaa.Impl!(pr96152.__unittest_L20_C7().ThrowingElement,
int).Impl.length() const

   0x961b0 <>:  save  %sp, -96, %sp
   0x961b4 <+4>:        st  %i0, [ %fp + 0x44 ]
   0x961b8 <+8>:        ld  [ %fp + 0x44 ], %g1
=> 0x961bc <+12>:       ld  [ %g1 + 8 ], %g2

(gdb) p/x $i0
$3 = 0x2

(gdb) bt
#0  0x000961bc in
core.internal.newaa.Impl!(pr96152.__unittest_L20_C7().ThrowingElement,
int).Impl.length() const (this=...)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/newaa.d:272
#1  0x00096390 in
core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA.length() const (this=...)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/newaa.d:55
#2  0x00095adc in
core.internal.newaa._aaEqual!(const(core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA), pr96152.__unittest_L20_C7().ThrowingElement, int)._aaEqual(scope
const(core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA), scope
const(core.internal.newaa.AA!(pr96152.__unittest_L20_C7().ThrowingElement,
int).AA)) (aa1=..., aa2=...)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/newaa.d:857
#3  0x00093c54 in
core.internal.newaa._d_aaEqual!(pr96152.__unittest_L20_C7().ThrowingElement,
int)._d_aaEqual(scope const(int[pr96152.__unittest_L20_C7().ThrowingElement]),
scope const(int[pr96152.__unittest_L20_C7().ThrowingElement])) (
    a1=..., a2=...)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/newaa.d:882
#4  0x000939a0 in pr96152.__unittest_L20_C7() ()
    at /vol/gcc/src/hg/master/local/gcc/testsuite/gdc.dg/torture/pr96152.d:31
#5  0x00096034 in _D7pr961529__modtestFZv ()
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/newaa.d:875
#6  0x000bf620 in __foreachbody_L651_C5 (__capture=0xffbfeb4c, 
    m=0x13a2c4 <ModuleInfo for pr96152>)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/runtime.d:663
#7  0x000adc14 in __lambda_L2519_C13 (__capture=0xffbfeaa8, 
    m=0x13a2c4 <ModuleInfo for pr96152>)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/object.d:2519
#8  0x000a6850 in __foreachbody_L585_C5 (__capture=0xffbfea34, sg=...)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/minfo.d:592
#9  0x0009a208 in gcc.sections.elf.DSO.opApply(scope int(ref
gcc.sections.elf.DSO) delegate) (dg=...)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/gcc/sections/elf.d:106
#10 0x000a7e24 in rt.minfo.moduleinfos_apply(scope
int(immutable(object.ModuleInfo*)) delegate) (
    dg=<error reading variable: Cannot access memory at address 0x0>)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/minfo.d:585
#11 0x000af7a8 in object.ModuleInfo.opApply(scope int(object.ModuleInfo*)
delegate) (dg=...)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/object.d:2518
#12 0x000c067c in runModuleUnitTests ()
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/runtime.d:651
#13 0x00098ec8 in runAll (__capture=__capture@entry=0xffbfece4)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:511
#14 0x00099170 in tryExec (__capture=0xffbfece4, dg=...)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:478
#15 _d_run_main2 (args=..., totalArgsLength=<optimized out>, 
    mainFunc=<optimized out>)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:549
#16 0x000992d0 in _d_run_main (argc=1, argv=<optimized out>, 
    mainFunc=0x9613c <D main>)
    at /vol/gcc/src/hg/master/local/libphobos/libdruntime/rt/dmain2.d:323
#17 0x00096174 in main (argc=1, argv=0xffbfee3c)
    at
/vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/entrypoint.d:29
#18 0x00093584 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

This SIGBUS seems to be the cause of the vast majority of regressions.

Reply via email to