Subject: Re: strerror(3) memory leak ?
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 03/27/2006 02:45:50
In article <20060327012241.GA49616@aries.rezid.net>,
Arnaud Lacombe  <lists-netbsd@sigfpe.info> wrote:
>On Mon, Mar 27, 2006 at 12:35:56AM +0100, Rui Paulo wrote:
>> Nicolas Joly <njoly@pasteur.fr> writes:
>> > #include <string.h>
>> >
>> > int main() {
>> >   char *msg;
>> >
>> >   while (1) {
>> >     msg = strerror(1);
>> >   }
>> >
>> >   return 0; }
>> >
>> > Did i missed something, or this is a real leak ?
>> 
>> I think this is a real leak and is related to NLS/i18n.
>yes, it seems so.
>
>The following code extracted from strerror_r() also produce the leak:
>
>int main() {
>  nl_catd catd;
>  while (1) {
>    catd = catopen("libc", NL_CAT_LOCALE);
>    catclose(catd);
>  }
>  return 0;
>}
>
>The leak seems to be in lib/libc/citrus/* somewhere in
>_citrus_lookup_simple() as if catopen.c is build without -DCITRUS (
>which implies that citrus/*.h are not included and _lookup_alias() is
>hardcoded), the leak doesn't occur. I doesn't have time to dig more by
>now, sorry.

cvs update and recompile.

christos