From owner-freebsd-hackers@freebsd.org Thu Apr 27 12:36:58 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C833D51637 for ; Thu, 27 Apr 2017 12:36:58 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (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 594F219CC for ; Thu, 27 Apr 2017 12:36:58 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 38E9D32BFE; Thu, 27 Apr 2017 14:36:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zh2T_NbwucNh; Thu, 27 Apr 2017 14:36:53 +0200 (CEST) Received: from [192.168.10.10] (asus [192.168.10.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 8B1C332BFD for ; Thu, 27 Apr 2017 14:36:53 +0200 (CEST) To: "freebsd-hackers@freebsd.org" From: Willem Jan Withagen Subject: Disabling program core dumps Message-ID: <32ac85ed-f0e5-2f80-299a-3bb1166cd5e6@digiware.nl> Date: Thu, 27 Apr 2017 14:36:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Apr 2017 12:36:58 -0000 Hi, Running (googletest) tests some are expected to die: EXPECT_DEATH(). This normally dumps a core, but since it is expected that core is rather useless. Thusfar I've found the best way to limit a program to dump core (from within the program) is to set its RLIMIT_CORE to 0. So I can do this before the test, and then set the old size back once the test is finished. Or is there another way, like setting a flag in process state (which I have not been able to find) --WjW