Re: ntpd segfaults on start

From: Cy Schubert <Cy.Schubert_at_cschubert.com>
Date: Sat, 07 Sep 2019 09:28:15 -0700
In message <20190907161749.GJ2559_at_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 <Cy.Schubert_at_cschubert.com>
FreeBSD UNIX:  <cy_at_FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.
Received on Sat Sep 07 2019 - 14:28:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC