test: the fixtures that crash on purpose leave no core dump on Linux #2293
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2293
Loading…
Reference in a new issue
No description provided.
Delete branch "test/no-core-dumps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every run of
tests/run_all.pyon a Linux desktop leaves three core dumps, and with a crash notifier three "a programcrashed" messages: three fixtures crash on purpose, and the kernel hands each crash to the core-dump handler
(systemd-coredump here).
Part of #2334.
tests/test_linux_driver_fault_guard.py'sguardfault-outside(a fault outside the guarded call must still kill the process)tests/test_recorder_sync.py'srecorder_sync_testOn one machine that ran the checks many times in one night, that made 107 crash notifications.
What changed
prctl(PR_SET_DUMPABLE, 0)at the start ofmain, on Linux only (#ifdef __linux__). Thekernel then makes no core dump for the process and starts no handler, whatever
ulimit -candcore_patternsay;the process still ends by its signal, so the checks see exactly what they saw before.
tests/recorder_sync_test.cppit sits beside the existingSetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS), which does the same job on Windows (no crash dialog).core_patternthe kernel does notapply
RLIMIT_CORE(core(5)), except the special value 1, so a limit of 0 still starts the handler; and the dumpableflag cannot be set from the parent, since
execveresets it.Tests only; nothing in the game or the builder changes.
How it was tested
Arch Linux,
ulimit -cunlimited,core_pattern=|/usr/lib/systemd/systemd-coredump ...; both tests run directly(not through
run_all.py),coredumpctl listbefore and after:guard(SIGSEGV), onebroken12/recorder_sync_test.exe(SIGSEGV) and one
broken13/recorder_sync_test.exe(SIGABRT) core dump per run of the checks (40, 32 and 32 overtwo days).
tests/test_linux_driver_fault_guard.pywith Clang 23.1.3 and GCC 16.2.1, andtests/test_recorder_sync.py(the two variants still end with exit codes -11 and -6, and are caught):
coredumpctl listshows no new entry. Thekernel still logs its usual
segfault at ...line for each fault.tests/test_recorder_sync.py(49f75dc8), run with core dumps blocked from outside(a core-size limit of 1), prints the same 22 broken-variant lines, exit codes included, and the same PASS line as this
branch's run (the two outputs compared with
diff); main's guard test passes the same way.python -I -B tests/run_all.pyon main49f75dc8with this change (2026-11-11, load about 70 to 135): 362 passed, 2failed, 10 skipped; both changed tests pass. The two failures are this machine's and fail on main as well, each with a
pull request of its own:
tests/test_wayland_libdecor_hint.py(Clang 23, #2290) andtests/test_updater_asset_digest.py(only a .NET 10 SDK here).Not tested
is expected; not tried.
Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 [email protected]
Rebased onto main
b29967bfso the workflows run here: they had waited for an approval on the old head, and main's game-free tests are green again since #2380. The patch is unchanged (git range-diff: the commit is equal), and its test passes on the new base.Looks good.
prctl(PR_SET_DUMPABLE, 0)at the top ofmainis the right place for this: as the description says,execveresets the flag, so the parent can't set it, andRLIMIT_COREdoesn't help with a pipedcore_pattern. Both changes are behind#ifdef __linux__, so Windows is untouched, and the fixtures still end by their signal. I rantests/test_linux_driver_fault_guard.pyandtests/test_recorder_sync.pyat this head on Linux and both pass. I also checked that neither fixture reads/proc/selfor uses ptrace, which a non-dumpable process would lose access to. No other test intests/ornx2/expects a signal exit, so these really are the only crashing fixtures.The red CI checks don't come from this PR. On Windows the failure is
tests/test_native_astc_texture_count.py(scanfdeprecated under-Werror), which main fixed in #2397. Theappimagejob hit Launchpad connection timeouts. A rebase onto current main should clear the Windows one.Thanks for checking both fixtures and the Linux-only guard. This is now merged as
75fa99f9.