Skip to content

testutils: Use prctl PR_SET_DUMPABLE to silence core dumps on Linux

Simon McVittie requested to merge wip/smcv/prctl-undumpable into main
  • testutils: Factor out g_test_disable_crash_reporting()

    We're already repeating this in 4 places, and in a subsequent commit I'll extend it to do more.

  • testutils: Use prctl PR_SET_DUMPABLE to silence core dumps on Linux

    Otherwise, crashing tests like assert-msg-test will still report to pipe-based crash reporting frameworks like systemd-coredump, even though the RLIMIT_CORE limit is zero.


The very similar code in libdbus' test suite also has some Windows-specific mechanisms to turn off crash reporting in Windows builds, which could usefully go in this function too, but unfortunately most code in libdbus is not under a suitable license.

(The addition of a call to prctl PR_SET_DUMPABLE in libdbus was done by me on behalf of Collabora, so if it's copyrightable at all, there is no barrier to me contributing very similar code to GLib on behalf of Collabora.)

Merge request reports