From owner-svn-src-all@FreeBSD.ORG Sun Oct 12 21:53:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D068F649; Sun, 12 Oct 2014 21:53:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC6B8DA8; Sun, 12 Oct 2014 21:53:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CLrDKm001298; Sun, 12 Oct 2014 21:53:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CLrDp5001297; Sun, 12 Oct 2014 21:53:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410122153.s9CLrDp5001297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 12 Oct 2014 21:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273010 - head/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 21:53:13 -0000 Author: ngie Date: Sun Oct 12 21:53:13 2014 New Revision: 273010 URL: https://svnweb.freebsd.org/changeset/base/273010 Log: Implement 64MB memory limit for test to ensure that it fails reliably in 600 seconds; it would previously fail inconsistently when run in some virtual machine configurations This patch might need to be reverted or revisited later (see the attached PR for more details) PR: 169302 Submitted by: pho Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Sun Oct 12 19:12:48 2014 (r273009) +++ head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Sun Oct 12 21:53:13 2014 (r273010) @@ -45,6 +45,9 @@ __RCSID("$NetBSD: t_exhaust.c,v 1.7 2011 #include #include #include +#if defined(__FreeBSD__) +#include +#endif #ifndef REGEX_MAXSIZE #define REGEX_MAXSIZE 9999 @@ -176,14 +179,25 @@ ATF_TC_HEAD(regcomp_too_big, tc) " crash, but return a proper error code"); // libtre needs it. atf_tc_set_md_var(tc, "timeout", "600"); +#if defined(__FreeBSD__) + atf_tc_set_md_var(tc, "require.memory", "64M"); +#else atf_tc_set_md_var(tc, "require.memory", "120M"); +#endif } ATF_TC_BODY(regcomp_too_big, tc) { regex_t re; +#if defined(__FreeBSD__) + struct rlimit limit; +#endif int e; +#if defined(__FreeBSD__) + limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024; + ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); +#endif for (size_t i = 0; i < __arraycount(tests); i++) { char *d = (*tests[i].pattern)(REGEX_MAXSIZE); e = regcomp(&re, d, tests[i].type);