mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
gtestutils: Set coredump rlimit to 0 when calling g_test_trap_fork()
g_test_trap_fork() is deprecated, but it’s still tested in the GLib tests. If we don’t set the coredump rlimit to 0 to prevent coredumps, the test for it creates a coredump (which is expected). On systems with systemd-coredump, that causes systemd-coredump to spawn and process the coredump for a while. That slows down the tests, and results in spurious coredump lists in the system logs. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #436
This commit is contained in:
@@ -3311,6 +3311,18 @@ g_test_trap_fork (guint64 usec_timeout,
|
|||||||
close (stdout_pipe[1]);
|
close (stdout_pipe[1]);
|
||||||
if (stderr_pipe[1] >= 3)
|
if (stderr_pipe[1] >= 3)
|
||||||
close (stderr_pipe[1]);
|
close (stderr_pipe[1]);
|
||||||
|
|
||||||
|
/* We typically expect these child processes to crash, and some
|
||||||
|
* tests spawn a *lot* of them. Avoid spamming system crash
|
||||||
|
* collection programs such as systemd-coredump and abrt.
|
||||||
|
*/
|
||||||
|
#ifdef HAVE_SYS_RESOURCE_H
|
||||||
|
{
|
||||||
|
struct rlimit limit = { 0, 0 };
|
||||||
|
(void) setrlimit (RLIMIT_CORE, &limit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else /* parent */
|
else /* parent */
|
||||||
|
Reference in New Issue
Block a user