From owner-freebsd-hackers@freebsd.org Wed Nov 28 14:43:42 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCE79115688C for ; Wed, 28 Nov 2018 14:43:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 23B4777030; Wed, 28 Nov 2018 14:43:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wASEhSZh021297 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Nov 2018 16:43:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wASEhSZh021297 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wASEhSgq021296; Wed, 28 Nov 2018 16:43:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 Nov 2018 16:43:28 +0200 From: Konstantin Belousov To: Willem Jan Withagen Cc: cem@freebsd.org, "freebsd-hackers@freebsd.org" Subject: Re: setting distinct core file names Message-ID: <20181128144328.GF2378@kib.kiev.ua> References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 23B4777030 X-Spamd-Result: default: False [-5.12 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; IP_SCORE(-2.13)[ip: (-2.55), ipnet: 2001:470::/32(-4.50), asn: 6939(-3.49), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 14:43:42 -0000 On Wed, Nov 28, 2018 at 12:21:33PM +0100, Willem Jan Withagen wrote: > On 28-11-2018 11:43, Willem Jan Withagen wrote: > > On 27-11-2018 21:46, Conrad Meyer wrote: > >> One (ugly) trick is to use multiple filesystem links to the script > >> interpreter, where the link names distinguish the scripts.  E.g., > >> > >> $ ln /bin/sh /libexec/my_script_one_sh > >> $ ln /bin/sh /libexec/my_script_two_sh > >> $ cat myscript1.sh > >> #!/libexec/my_script_one_sh > >> ... > >> > >> Cores will be dumped with %N of "my_script_one_sh." > > > > Neat trick... got to try and remember this. > > But it is not the shell scripts that are crashing... > > > > When running Ceph tests during Jenkins building some > > programs/executables intentionally crash leaving cores. > > Others (scripts) use some of these programs with correct input and > > should NOT crash. And test during startup and termination that there are > > no cores left. > > > > One jenkins test run takes about 4 hours when not executed in parallel. > > I'm testing 4 version multiple times a day to not have this huge list of > > PRs the go thru when testing fails. > > > > But the intentional cores and the failure cores here collide. > > And when I have a core program_x.core I can't tell if they are from a > > failure or from an intentional crash. > > > > Now if could tell per program  how to name its core that would allow me > > to fix the problem, without overturning the complete Ceph testing > > infrastructure and still keep parallel tests. > > > > It would also help in that "regular" cores just keep going the way the > > are. So other application still have the same behaviour. And are still > > picked up by periodic processing. > > So I read a bit more about the prcctl and prctl(the Linux variant) and > turns out that Linux can set PR_SET_DUMPABLE. And that is actually used > in some of the Ceph applications... > > Being able to set this to 0 or 1 would perhaps be a nice start as well. Isn't setrlimit(RLIMIT_CORE, 0) enough ? It is slightly different syntax, but the idea is that you set RLIMIT_CORE to zero, then we do not even start dumping.