Threadproofing msyslog

Hal Murray hmurray at megapathdsl.net
Mon Mar 11 19:51:14 UTC 2019


There is another big worm in that can.

libntp/lib_strbuf allocates strings for temporary use.  It's simple, 
round-robin from an array.  There is no garbage collection.  That works if the 
array is big enough.

Actually, "big enough" only works in the single threaded case.

It's used for things like socktoa which is often used is msyslog messages.

There are 2 obvious ways to fix it.  One is to fix all the callers to provide 
the buffer.

The other would be to make the low level routine have a per-thread array of 
strings.

We have 2 long running threads, the NTS-KE server, and one short lived thread 
for DNS/NTS lookup.

I'm thinking about adding a thread-init routine to work around some SSL 
quirks.  We could add a call-out to set things up and another one when a 
thread goes away.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list