|
Message-ID: <tencent_09D85CFC4A2C0B692E72685FACDBAB7B9807@qq.com>
Date: Wed, 15 Feb 2023 09:45:49 +0800
From: "兔子猪" <3264430019@...com>
To: "musl" <musl@...ts.openwall.com>
Subject: 回复: [PATCH]fix tsd's issue
I got it, I am using version 1.2.0, Next I will switch to the latest version.
------------------ 原始邮件 ------------------
发件人: "musl" <dalias@...c.org>;
发送时间: 2023年2月14日(星期二) 晚上9:44
收件人: "兔子猪"<3264430019@...com>;
抄送: "musl"<musl@...ts.openwall.com>;
主题: Re: [musl][PATCH]fix tsd's issue
On Tue, Feb 14, 2023 at 07:05:15AM -0500, Rich Felker wrote:
> On Tue, Feb 14, 2023 at 03:25:23PM +0800, 兔子猪 wrote:
> > Currently, I am trying to port jemalloc to musl, I have found a issue "the return value of pthread_getspecific is not correct". The reasons are as follows:
> > 1, Jemalloc uses pthread_key_t to implement cache feature, if codes call malloc, pthread_create_key will called and tsd will be initizlized.
> > 2, Musl calls malloc before updating TLS size in dl stage 3.
> > 3, New created initial_tls doesn't carry builtin_tls's tsd.
> >
> >
> > The attached patch could fix this issue, please review it, thanks.
>
> An interposed malloc being reachable before the crt1 entry point is a
> bug that needs to be fixed. This is a context where it's not valid to
> call any application-provided code. Where does the call happen from?
> dynlink.c itself uses the internal malloc but I guess there's
> somewhere the interposable malloc is getting called indirectly from.
I went looking for it and couldn't find any sign of malloc
reachability unless you go back to 1.2.1. Commit
c1e5d243b7e39b2fbfb17144608ce045575d8e95 removed the use via stdio,
and 34952fe5de44a833370cbe87b63fb8eec61466d7 switched to internal
malloc for all direct use from ldso. Are you just using a really old
version?
Rich
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.