From owner-freebsd-hackers@freebsd.org Thu Apr 27 13:39:14 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 1AA07D53CF4 for ; Thu, 27 Apr 2017 13:39:14 +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 DB7B5153 for ; Thu, 27 Apr 2017 13:39:13 +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 002E132B77; Thu, 27 Apr 2017 15:39:12 +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 GrbqawAaT1Ob; Thu, 27 Apr 2017 15:39:11 +0200 (CEST) Received: from [192.168.10.67] (opteron [192.168.10.67]) (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 5311E32B45; Thu, 27 Apr 2017 15:39:11 +0200 (CEST) Subject: Re: Disabling program core dumps To: Konstantin Belousov References: <32ac85ed-f0e5-2f80-299a-3bb1166cd5e6@digiware.nl> <20170427125725.GM1622@kib.kiev.ua> Cc: "freebsd-hackers@freebsd.org" From: Willem Jan Withagen Message-ID: <2e645e8d-125c-b2c8-1401-5a9da68ce5fb@digiware.nl> Date: Thu, 27 Apr 2017 15:39:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170427125725.GM1622@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 13:39:14 -0000 On 27-4-2017 14:57, Konstantin Belousov wrote: > On Thu, Apr 27, 2017 at 02:36:52PM +0200, Willem Jan Withagen wrote: >> 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) > See procctl(2) PROC_TRACE_CTL command. Disabling tracing also disables > coredumping. Ah, that I did not find. Found procctl, but browsed thru it looking for coredump, but it is wrapped over 2 lines :) So setting PROC_TRACE_CTL_DISABLE_EXEC would work with googletests which fork to actually run the DEATH tests?? --WjW