From: Florian Weimer <fweimer@redhat.com>
To: Andreas Schwab <schwab@suse.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] libio: Fix gconv-related memory leak [BZ #24583]
Date: Mon, 20 May 2019 17:40:28 +0200 [thread overview]
Message-ID: <87a7fhi177.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <mvm1s0tkyqf.fsf@suse.de> (Andreas Schwab's message of "Mon, 20 May 2019 16:05:28 +0200")
* 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
next prev parent reply other threads:[~2019-05-20 15:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 12:17 [PATCH] libio: Fix gconv-related memory leak [BZ #24583] Florian Weimer
2019-05-20 14:05 ` Andreas Schwab
2019-05-20 15:40 ` Florian Weimer [this message]
2019-05-20 19:04 ` Florian Weimer
2019-05-21 7:19 ` Andreas Schwab
2019-05-21 8:53 ` Florian Weimer
2019-05-21 9:22 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a7fhi177.fsf@oldenburg2.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).