Page MenuHomeFreeBSD

Reduce NL_ARGMAX to 4096 to match Linux.
ClosedPublic

Authored by brooks on Oct 2 2018, 11:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 13, 12:01 AM
Unknown Object (File)
Thu, Apr 11, 10:13 AM
Unknown Object (File)
Mon, Apr 8, 5:44 AM
Unknown Object (File)
Mon, Apr 8, 5:33 AM
Unknown Object (File)
Mar 10 2024, 9:27 PM
Unknown Object (File)
Mar 10 2024, 9:27 PM
Unknown Object (File)
Mar 10 2024, 9:27 PM
Unknown Object (File)
Mar 7 2024, 9:57 PM
Subscribers

Details

Summary

NL_ARGMAX is the maximum number of postional arguments supported by
pritnf(3). Prior to r308145 it was declared as 99 and not enforced.
r308145 added enforcement and increased the value to 64k.

Unfortunately, development versions of PostgreSQL used the system definition to allocate and
zero an NL_ARGMAX * 4 sized array on the stack of its snprintf
implementation with measureable performance impacts. This has been
fixed in new PostgreSQL versions, but it is possible that other programs suffer from this
problem.

A value of 4096 puts us on par with Linux and is certainly large enough
for any reasionable program.

Reported by: mjg

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I got a confirmation this is only an issue in the development version - older postgres verisions have the code but don't use it.

Regardless, the value should drop.

This revision is now accepted and ready to land.Oct 4 2018, 11:02 AM
This revision was automatically updated to reflect the committed changes.