Bug 83772 - turn off core dumps from the regression tests, more thoroughly
Summary: turn off core dumps from the regression tests, more thoroughly
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact:
URL:
Whiteboard: review?
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-09-11 16:04 UTC by Simon McVittie
Modified: 2014-09-15 12:02 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
On Linux, call prctl to disable core dumps (1.86 KB, patch)
2014-09-11 16:04 UTC, Simon McVittie
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Simon McVittie 2014-09-11 16:04:21 UTC
The regression tests include an activatable service that deliberately raises SIGSEGV or segfaults, to verify that "process was killed by a signal" is reported correctly. It tries to turn off core dumps with setrlimit(), since its "crashes" are not really a problem.

However, when Linux's /proc/sys/kernel/core_pattern is set to a pipe (e.g. "|/usr/lib/corekeeper/dump %d %u %p-%u-%g-%s-%t-%h-%E.core" for the corekeeper utility), the kernel ignores RLIMIT_CORE. This is deliberate, to be able to catch crashes during boot before a configurable rlimit has been applied (e.g. see <https://lkml.org/lkml/2011/8/24/136>), but is inconvenient here.

We can use the Linux-specific prctl() syscall to turn off core dumps more thoroughly.
Comment 1 Simon McVittie 2014-09-11 16:04:54 UTC
Created attachment 106143 [details] [review]
On Linux, call prctl to disable core dumps

Whenever I forget to turn off corekeeper, the regression tests
take ages to record all test-segfault's crashes.
Comment 2 Alban Crequy 2014-09-12 16:48:14 UTC
Comment on attachment 106143 [details] [review]
On Linux, call prctl to disable core dumps

Review of attachment 106143 [details] [review]:
-----------------------------------------------------------------

::: configure.ac
@@ +600,5 @@
>  
> +# For test-segfault.c
> +AC_CHECK_HEADERS_ONCE([sys/prctl.h])
> +AC_CHECK_FUNCS_ONCE([prctl raise])
> +

Do the _ONCE checks work with old versions of autoconf?
Comment 3 Simon McVittie 2014-09-12 16:55:30 UTC
(In reply to comment #2)
> Do the _ONCE checks work with old versions of autoconf?

Yes. They were new in 2.59c, back in 2006.
Comment 4 Simon McVittie 2014-09-12 16:56:21 UTC
(In reply to comment #3)
> Yes. They were new in 2.59c, back in 2006.

(And we require 2.63 already.)
Comment 5 Alban Crequy 2014-09-14 13:22:38 UTC
It looks good to me then.
Comment 6 Simon McVittie 2014-09-15 12:02:57 UTC
Fixed in git for 1.8.8, 1.9.0


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.