From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fw@deneb.enyo.de>,
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH 05/13] string: Remove old TLS usage on strsignal
Date: Mon, 1 Jun 2020 15:39:16 -0300 [thread overview]
Message-ID: <edca4920-6dfe-0cbc-8b4b-451a7961b843@linaro.org> (raw)
In-Reply-To: <87tuzuwt5m.fsf@mid.deneb.enyo.de>
On 01/06/2020 15:13, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>>>> diff --git a/malloc/thread-freeres.c b/malloc/thread-freeres.c
>>>> index c71ca4fc33..d42eea770b 100644
>>>> --- a/malloc/thread-freeres.c
>>>> +++ b/malloc/thread-freeres.c
>>>> @@ -32,6 +32,7 @@ __libc_thread_freeres (void)
>>>> call_function_static_weak (__rpc_thread_destroy);
>>>> call_function_static_weak (__res_thread_freeres);
>>>> call_function_static_weak (__strerror_thread_freeres);
>>>> + call_function_static_weak (__strsignal_thread_freeres);
>>>
>>> I think you can call free directly. I doubt it increases binary
>>> size—the data is in the thread descriptor, so nothing needs to be pulled
>>> into the link for this.
>>
>> Don't we need it to deallocate the memory in the case of a libc
>> loaded in a different namespace?
>
> Right, but using call_function_static_weak does not achieve that.
> This is a general problem with using TLS that needs separate
> deallocation. We don't have per-namespace thread exit hooks, but we
> probably need them.
>
My confusion in fact, this is another issue indeed. I added it just
to follow the small optimization dony by __strerror_thread_freeres
to avoid pulling the free code on static usage.
So do you think it would be better to just call free on
__libc_thread_freeres (it should be ok since code initializes it to
NULL)? If so, maybe also do the same for __strerror_thread_freeres?
next prev parent reply other threads:[~2020-06-01 18:39 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 18:05 [PATCH 00/13] Signal and error list refactoring Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH v2 01/13] signal: Add signum-{generic,arch}.h Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH v3 02/13] signal: Move sys_siglist to a compat symbol Adhemerval Zanella via Libc-alpha
2020-05-28 14:50 ` Florian Weimer via Libc-alpha
2020-05-19 18:05 ` [PATCH v3 03/13] signal: Move sys_errlist " Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 04/13] linux: Fix __NSIG_WORDS and add __NSIG_BYTES Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 05/13] string: Remove old TLS usage on strsignal Adhemerval Zanella via Libc-alpha
2020-05-28 11:38 ` Florian Weimer via Libc-alpha
2020-06-01 18:08 ` Adhemerval Zanella via Libc-alpha
2020-06-01 18:13 ` Florian Weimer
2020-06-01 18:39 ` Adhemerval Zanella via Libc-alpha [this message]
2020-06-01 18:43 ` Florian Weimer
2020-05-19 18:05 ` [PATCH 06/13] string: Implement strerror in terms of strerror_l Adhemerval Zanella via Libc-alpha
2020-05-28 11:41 ` Florian Weimer via Libc-alpha
2020-06-01 18:28 ` Adhemerval Zanella via Libc-alpha
2020-06-03 8:24 ` Florian Weimer via Libc-alpha
2020-06-03 15:13 ` Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 07/13] string: Use tls-internal on strerror_l Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 08/13] string: Simplify strerror_r Adhemerval Zanella via Libc-alpha
2020-05-28 11:56 ` Florian Weimer via Libc-alpha
2020-06-01 18:31 ` Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 09/13] string: Add strsignal test Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 10/13] string: Add strerror, strerror_r, and strerror_l test Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 11/13] string: Add strerror_l on test-strerror-errno Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 12/13] string: Add sigabbrev_np and sigdescr_np Adhemerval Zanella via Libc-alpha
2020-05-19 18:47 ` Joseph Myers
2020-05-28 12:31 ` Florian Weimer via Libc-alpha
2020-06-03 16:39 ` Adhemerval Zanella via Libc-alpha
2020-05-19 18:05 ` [PATCH 13/13] string: Add errname_np and errdesc_np Adhemerval Zanella via Libc-alpha
2020-05-28 12:28 ` Florian Weimer via Libc-alpha
2020-06-01 20:52 ` Adhemerval Zanella via Libc-alpha
2020-06-02 17:13 ` Adhemerval Zanella via Libc-alpha
2020-06-02 17:19 ` Florian Weimer via Libc-alpha
2020-06-02 17:20 ` Adhemerval Zanella via Libc-alpha
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=edca4920-6dfe-0cbc-8b4b-451a7961b843@linaro.org \
--to=libc-alpha@sourceware.org \
--cc=adhemerval.zanella@linaro.org \
--cc=fw@deneb.enyo.de \
--cc=fweimer@redhat.com \
/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).