This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libio: Fix gconv-related memory leak [BZ #24583]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 20 May 2019 17:40:28 +0200
- Subject: Re: [PATCH] libio: Fix gconv-related memory leak [BZ #24583]
- References: <87sgt9jp5x.fsf@oldenburg2.str.redhat.com> <mvm1s0tkyqf.fsf@suse.de>
* Andreas Schwab:
> On Mai 20 2019, Florian Weimer <fweimer@redhat.com> wrote:
>
>> diff --git a/libio/iofclose.c b/libio/iofclose.c
>> index 8a80dd0b78..f4c7299db3 100644
>> --- a/libio/iofclose.c
>> +++ b/libio/iofclose.c
>> @@ -61,10 +61,10 @@ _IO_new_fclose (FILE *fp)
>> the conversion functions. */
>> struct _IO_codecvt *cc = fp->_codecvt;
>>
>> - __libc_lock_lock (__gconv_lock);
>> - __gconv_release_step (cc->__cd_in.__cd.__steps);
>> - __gconv_release_step (cc->__cd_out.__cd.__steps);
>> - __libc_lock_unlock (__gconv_lock);
>> + __gconv_close_transform (cc->__cd_in.__cd.__steps,
>> + cc->__cd_in.__cd.__nsteps);
>> + __gconv_close_transform (cc->__cd_out.__cd.__steps,
>> + cc->__cd_out.__cd.__nsteps);
>
> Are the __steps always allocated? In get_gconv_fcts I see them being
> set to static data.
Correct, this needs to be handled differently. It is difficult to
reproduce because the test framework disables the gconv cache (even when
running in a container).
I will try to fix the test framework first.
Thanks,
Florian