Skip to content

Commit 2333e27

Browse files
committed
[druntime-test]: exceptions: Skip spurious memoryerror
These tests seem to fail with a shared druntime (depending on arch as well), and work with a static one. CI fails with a static druntime though. A gdb backtrace with a shared druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /root/build/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000005555550afc in D main () (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 (gdb) bt \#0 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \#1 0x0000007ff77563b8 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \#2 0x0000007ff7757000 in _Unwind_Backtrace () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \#3 0x0000007ff78b2c6c in backtrace () from /usr/lib64/libc.so.6 \#4 0x0000007ff7aee058 in core.lifetime.emplace!(core.runtime.DefaultTraceInfo).emplace(core.runtime.DefaultTraceInfo) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \#5 0x0000007ff7aed1f0 in core.runtime.defaultTraceHandler(void*) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \#6 0x0000007ff7b09614 in _d_createTrace () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \#7 0x0000007ff7b0a7a0 in _d_throw_exception () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \#8 0x0000007ff7acb418 in _d_assert_msg () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \#9 0x0000005555550d18 in etc.linux.memoryerror.registerMemoryAssertHandler!().registerMemoryAssertHandler()._d_handleSignalAssert(int, core.sys.posix.signal.siginfo_t*, void*) () \#10 <signal handler called> \#11 0x0000005555550afc in D main () ``` And with a static druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /tmp/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000555556a4bc in D main () (gdb) c Continuing. core.exception.AssertError@/usr/lib/ldc2/1.41/include/d/etc/linux/memoryerror.d(415): segmentation fault: null pointer read/write operation ---------------- ??:? [0x555557fa2f] ??:? [0x555557f1ab] ??:? [0x5555581d17] ??:? [0x5555570893] ??:? [0x555556b2ab] ??:? [0x555556a6d7] ??:? [0x7ff7ffb797] ??:? [0x555556a4bb] ??:? [0x5555570567] ??:? [0x5555570413] ??:? [0x5555570277] ??:? [0x555556a5a3] ??:? [0x7ff7d02053] ??:? __libc_start_main [0x7ff7d02137] ??:? [0x555556a3af] Program received signal SIGSEGV, Segmentation fault. 0x0000007ffffffdd0 in ?? () ``` Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
1 parent 51d0eed commit 2333e27

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

runtime/DRuntimeIntegrationTests.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ foreach(name ${testnames})
8989
ROOT=${outdir} DMD=${LDMD_EXE_FULL} BUILD=${build} SHARED=1
9090
DRUNTIME=${druntime_path_build} DRUNTIMESO=${shared_druntime_path_build}
9191
${cc} ${cxx} CFLAGS_BASE=${cflags_base} DFLAGS_BASE=${dflags_base} ${linkdl}
92-
IN_LDC=1 ${musl}
92+
IN_LDC=1 ${musl} BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
9393
)
9494
set_tests_properties(${fullname} PROPERTIES DEPENDS clean-${fullname})
9595
endforeach()

runtime/druntime/test/exceptions/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ ifdef IN_LDC
6565
# rt.dwarfeh._d_throw_exception:399 unwind switch statement.
6666
# The value is 0xf7fe7fb8 which is complete garbage.
6767
TESTS := $(filter-out memoryerror_null_call,$(TESTS))
68+
69+
# The aarch64 github runners fail but it works locally
70+
TESTS := $(filter-out memoryerror_%,$(TESTS))
71+
endif
72+
73+
ifeq ($(OS),linux)
74+
# These maybe fail with a shared runtime.
75+
#
76+
# CircleCI fails on x86_64, other CI and locally work.
77+
# aarch64 fails locally, shared-only is not tested in CI.
78+
#
79+
# The failure is caused by the backtrace call in
80+
# core.runtime.DefaultTraceInfo.this
81+
ifeq ($(BUILD_SHARED_LIBS),ON)
82+
TESTS := $(filter-out memoryerror_%,$(TESTS))
83+
endif
84+
$(ROOT)/memoryerror_%: private extra_ldflags.d += -link-defaultlib-shared=false
6885
endif
6986
endif
7087

0 commit comments

Comments
 (0)