https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249416
Bug ID: 249416
Summary: Each call to newlocale(3) with a non-null base
argument results in additional memory usage
Product: Base System
Version: 12.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
Attachment #218038 text/plain
mime type:
Created attachment 218038
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=218038&action=edit
newlocale() test program
There appears to be a memory usage issue with newlocale(3) when called with a
base argument. This recently started showing symptoms in devel/json-c programs
using version 0.14 and higher which started using newlocale() due to a change
in the cmake configuration. Here is the devel/json-c PR:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249412
Here is the upstream ticket I created:
https://github.com/json-c/json-c/issues/668
Eric Hawicz responded, suggesting that FreeBSD's implementation of newlocale()
might be causing the issue. His helpful test program confirms this. Attached to
this PR is a modified version that uses sysctl() to automatically track and
report changes to rss and vsz.
Eric points out that FreeBSD and linux man pages describe different behavior;
FreeBSD:
https://www.freebsd.org/cgi/man.cgi?query=newlocale&sektion=3&manpath=freebsd-release-ports
"Creates a new locale, inheriting some properties from an existing locale."
Note that there do not appear to be uses of newlocale() with a non-null base
argument in the current source tree; linux:
https://man7.org/linux/man-pages/man3/newlocale.3.html
"The newlocale() function creates a new locale object, or modifies an
existing object..."
And that posix says:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/newlocale.html
"The newlocale() function shall create a new locale object or modify an
existing one."
I did some testing with versions of lib/libc/locale going back to 2012 and all
had this issue.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"