November 21, 2023
https://issues.dlang.org/show_bug.cgi?id=24254

          Issue ID: 24254
           Summary: LDC crash on Epyc Bergamo
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: jurij.pecar@embl.de

Trying to figure out why Sambamba is crashing on Bergamo I noticed that issue is already present with LDC. Just trying to start it results in a stack trace:

LDC 1.24 binary build:

# ldc2
ldc2[0x33f03d4]
Floating point exception (core dumped)

LDC 1.35 built from source with Easybuild, LLVM 16.0.6, GCC 12.3

# ldc2
 #0 0x00007ffff43c6bbe llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/g/easybuild/x86_64/Rocky/8/genoa/software/LLVM/16.0.6-GCCcore-12.3.0/lib/libLLVM-16.so+0x918bbe)
 #1 0x00007ffff43c459b SignalHandler(int) Signals.cpp:0:0
 #2 0x00007ffff3494cf0 __restore_rt (/lib64/libpthread.so.0+0x12cf0)
 #3 0x0000000000c82ac4 _D4core5cpuid8cpuidX86FNbNiNeZv
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc82ac4)
 #4 0x0000000000c82c09 _D4core5cpuid26_sharedStaticCtor_L1065_C1FNbNiNeZv
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc82c09)
 #5 0x0000000000c9cbc9
_D2rt5minfo13rt_moduleCtorUZ14__foreachbody1MFKSQBu19sections_elf_shared3DSOZi
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc9cbc9)
 #6 0x0000000000c9db6a _D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc9db6a)
 #7 0x0000000000c93428 rt_init
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc93428)
 #8 0x0000000000c939ad _D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc939ad)
 #9 0x0000000000c93808 _d_run_main2
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc93808)
#10 0x0000000000c9365e _d_run_main
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0xc9365e)
#11 0x0000000000797e4d main
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0x797e4d)
#12 0x00007ffff2b4cd85 __libc_start_main (/lib64/libc.so.6+0x3ad85)
#13 0x000000000079a12e _start
(/g/easybuild/x86_64/Rocky/8/znver4/software/LDC/1.35.0-GCCcore-12.3.0/bin/ldc2+0x79a12e)


Can't run binary release 1.35 as it requires glibc 2.29 (el8 only has 2.28).

Does this stack trace ring any bells? Otherwise please let me know what further info would be useful to provide in order to fix this issue. It might be that root cause is further still, in llvm.

Thanks,

--