[OpenIndiana-discuss] ntpd has issues after upgraded to latest OI Hipster release today

Bill Sommerfeld sommerfeld at hamachi.org
Fri Oct 13 19:14:44 UTC 2023


On 7/29/23 13:31, Marcel Telka wrote:
> On Sat, Jul 29, 2023 at 03:06:50PM +0100, russell wrote:
>> Jul 29 13:21:14 tesla ntpd[1283]: [ID 702911 ntp.error] /jenkins/jobs/oi-userland/workspace/components/network/ntp/ntp-4.2.8p17/libntp/recvbuff.c:383:
>> REQUIRE(((void *)0) == pf->pptail || pptail == pf->pptail) failed
> 
> This is an old and well known bug in ntp:
> https://bugs.ntp.org/show_bug.cgi?id=3552

This has been hitting my systems periodically and I took a look.

Looking through the code, I stumbled upon this block in recvbuff.c:

#if defined(SYS_WINNT)

/*
  * For Windows we need to set up a lock to manipulate the
  * recv buffers to prevent corruption. We keep it lock for as
  * short a time as possible
  */
static CRITICAL_SECTION RecvLock;
static CRITICAL_SECTION FreeLock;
# define LOCK_R()	EnterCriticalSection(&RecvLock)
# define UNLOCK_R()	LeaveCriticalSection(&RecvLock)
# define LOCK_F()	EnterCriticalSection(&FreeLock)
# define UNLOCK_F()	LeaveCriticalSection(&FreeLock)

...

The openindiana build of ntpd will sporadically spawn a second thread 
for background processing for things like DNS lookups, so I hacked 
together a patch (attached; probably #ifdef'ed on the wrong thing) to 
add a lock for illumos as well.



More information about the openindiana-discuss mailing list