From owner-freebsd-current@freebsd.org Sat Sep 7 16:28:24 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A597D72E7 for ; Sat, 7 Sep 2019 16:28:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46QfxM0grhz3GcG for ; Sat, 7 Sep 2019 16:28:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 6dZQiiu74SrVc6dZRiQnVe; Sat, 07 Sep 2019 10:28:21 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=hJSPzmgovYHAIU_DXlIA:9 a=ml6RBKLhiWCBSNlM:21 a=2u4W6QJgkEN3HXM5:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3DD5132D; Sat, 7 Sep 2019 09:28:16 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x87GSGPH005830; Sat, 7 Sep 2019 09:28:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x87GSFPV005827; Sat, 7 Sep 2019 09:28:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909071628.x87GSFPV005827@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , Harlan Stenn , Vladimir Zakharov , freebsd-current@freebsd.org Subject: Re: ntpd segfaults on start In-reply-to: <20190907161749.GJ2559@kib.kiev.ua> References: <201909051307.x85D7MGs034053@slippy.cwsent.com> <20190905142817.GB2559@kib.kiev.ua> <201909060355.x863tRhP089169@slippy.cwsent.com> <201909060639.x866dJ7f090176@slippy.cwsent.com> <201909062356.x86NuKdk003780@slippy.cwsent.com> <156d1e7c-0dbb-8707-90b3-13ae97c87449@nwtime.org> <20190907075619.GG2559@kib.kiev.ua> <201909071309.x87D9GxZ089964@slippy.cwsent.com> <20190907153226.GI2559@kib.kiev.ua> <201909071545.x87FjLS6004448@slippy.cwsent.com> <20190907161749.GJ2559@kib.kiev.ua> Comments: In-reply-to Konstantin Belousov message dated "Sat, 07 Sep 2019 19:17:49 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 07 Sep 2019 09:28:15 -0700 X-CMAE-Envelope: MS4wfPlecJBAy1UMsiZkQyR0v2SknvtjhLsfrnhnNLXbbEuAoDL++P0THA11maVf2PO71W91Mx+EJjASuTMzxL6z8BzOAogxnGPo+p67pBXASbnaqfw8CdUY tFF/s8EVDnmgvRi7HsGk1O2CapOn11qX8lZxuQppP8iTY5WbnKn236Ez8u0aJ+7QflINixE8aDT8doq41m6RqoDlDts6RgeLtYtdGpOlUgu1lyItg4tZhphD X-Rspamd-Queue-Id: 46QfxM0grhz3GcG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.82 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[139.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; IP_SCORE(-2.23)[ip: (-5.56), ipnet: 64.59.128.0/20(-3.09), asn: 6327(-2.40), country: CA(-0.09)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Sep 2019 16:28:24 -0000 In message <20190907161749.GJ2559@kib.kiev.ua>, Konstantin Belousov writes: > On Sat, Sep 07, 2019 at 08:45:21AM -0700, Cy Schubert wrote: > > I've been able to set the memlock rlimit as low as 20 MB. The issue is > > letting it default to 0 which allows ntp to mlockall() anything it wants. > > ntpd on my sandbox is currently using 18 MB. > > Default stack size on amd64 is 512M, and default stack gap percentage is > 3%. This means that the gap can be as large as ~17MB. If 3MB is enough > for the stack of the main thread of ntpd, then fine. The default stack is 200K, which is also tuneable in ntp.conf. rlimit [memlock Nmegabytes | stacksize N4kPages filenum Nfiledescriptors] memlock Nmegabytes Specify the number of megabytes of memory that should be allocated and locked. Probably only available under Linux, this option may be useful when dropping root (the -i option). The default is 32 megabytes on non-Linux machines, and -1 under Linux. -1 means "do not lock the process into memory". 0 means "lock whatever memory the process wants into memory". stacksize N4kPages Specifies the maximum size of the process stack on systems with the mlockall() function. Defaults to 50 4k pages (200 4k pages in OpenBSD). filenum Nfiledescriptors Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.