svn commit: r292578 - in head/contrib/netbsd-tests/lib/libc: gen ssp

Garrett Cooper ngie at FreeBSD.org
Tue Dec 22 00:43:24 UTC 2015


Author: ngie
Date: Tue Dec 22 00:43:22 2015
New Revision: 292578
URL: https://svnweb.freebsd.org/changeset/base/292578

Log:
  Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test
  
  The default `sysctl kern.corefile` value is compatible with `kyua test` (FreeBSD
  will dump to the current directory). If it's set to an absolute path however,
  `kyua test` will not be able to clean up the corefiles after the fact
  
  The corefiles have little value when testing the behavior of feature behavior,
  so just disable corefile generation
  
  MFC after: 1 week
  Obtained from: Isilon OneFS (^/onefs/head at r511419)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_assert.c
  head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_assert.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/gen/t_assert.c	Mon Dec 21 23:47:49 2015	(r292577)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_assert.c	Tue Dec 22 00:43:22 2015	(r292578)
@@ -40,6 +40,23 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/
 #include <string.h>
 #include <unistd.h>
 
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+static void
+disable_corefile(void)
+{
+	struct rlimit limits;
+
+	limits.rlim_cur = 0;
+	limits.rlim_max = 0;
+
+	ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0);
+}
+#endif
+
 static void		handler(int);
 
 static void
@@ -65,6 +82,9 @@ ATF_TC_BODY(assert_false, tc)
 
 	if (pid == 0) {
 
+#ifdef __FreeBSD__
+		disable_corefile();
+#endif
 		(void)closefrom(0);
 		(void)memset(&sa, 0, sizeof(struct sigaction));
 
@@ -102,6 +122,9 @@ ATF_TC_BODY(assert_true, tc)
 
 	if (pid == 0) {
 
+#ifdef __FreeBSD__
+		disable_corefile();
+#endif
 		(void)closefrom(0);
 		(void)memset(&sa, 0, sizeof(struct sigaction));
 

Modified: head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh	Mon Dec 21 23:47:49 2015	(r292577)
+++ head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh	Tue Dec 22 00:43:22 2015	(r292578)
@@ -35,6 +35,7 @@ h_fail()
 {
 	echo "Executing command [ $2$1 ]"
 	# Begin FreeBSD
+	ulimit -c 0
 	if true; then
 		eval $2 atf_check -s signal -o ignore -e ignore $1
 	else


More information about the svn-src-all mailing list