From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by sourceware.org (Postfix) with ESMTPS id 5211A384C005 for ; Wed, 17 Mar 2021 19:09:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5211A384C005 Received: by mail-qv1-xf2a.google.com with SMTP id g8so1946576qvx.1 for ; Wed, 17 Mar 2021 12:09:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8oAyzm3bhYheJ5THXk6l+QsuT4RejNzMzOriStZkJNE=; b=FG//y+vz4Zja2scvzFx4ahAEbIcChXQ7YfdP44Ua/C4R8F93FRWXQDyvYLbdNXmGW3 938i2Oi9L9oFi/Kr6jBoLmPGQ6GOTp6+IS8myC30bxzyLS9SF797repAV6ubZZuREJF/ HTPsLQJsfc8YmbhMuSMitEhSK99vnxTfhp9DayFgfAs6M8yNDh9hdUj++EFiabVqAcLi hM9EEbJf82kMOTnf4X5hpSAAc0UtQ3FlyAyaZC5dTHhVXXtudGqy+b72L8USNu5/Rdpm zv2fHzTxEsvaOV4DSbdismB2c6AuqDf5QPoU/sDF/etBwqBEg3uliUmvQHHM/t5N3Euj Wh0Q== X-Gm-Message-State: AOAM531VBZDG5eJFFzD0pPdLubYO3f3lt85Rg6P0uEhaYHQ8PnPQpIjJ rusODiZMx6hMnqVhuIe5TBBFCAM9eP0+3VI8 X-Google-Smtp-Source: ABdhPJzMxMbN7r7i+7excNlbKksCBC2Fv3aYUSYUJqj1qFa3YXenX9ZS8R/YvMhL4BIfULxHiVhJcg== X-Received: by 2002:a05:6214:1d05:: with SMTP id e5mr662172qvd.36.1616008181758; Wed, 17 Mar 2021 12:09:41 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id q64sm16186705qtd.32.2021.03.17.12.09.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Mar 2021 12:09:41 -0700 (PDT) Subject: Re: [PATCH v3 08/37] nptl: Move pthread_once and __pthread_once into libc To: Florian Weimer Cc: libc-alpha@sourceware.org References: <3ab7ccc92585d17c3171cf375605b53252d6b9a9.1615914631.git.fweimer@redhat.com> <41a88cab-808e-c10e-a975-41cdd252c299@linaro.org> <5405bbad-3c70-4435-8815-59e84738c3fb@linaro.org> <87h7l93klm.fsf@oldenburg.str.redhat.com> <583d20d2-54fe-9c30-805e-7182e00965bc@linaro.org> <87v99p1zxh.fsf@oldenburg.str.redhat.com> <87lfal1xrw.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <7eb812ff-49e2-fea9-8245-1bb9a39e1839@linaro.org> Date: Wed, 17 Mar 2021 16:09:39 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <87lfal1xrw.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2021 19:09:46 -0000 On 17/03/2021 14:43, Florian Weimer wrote: > * Adhemerval Zanella: > >>> nss_ldap would silently link to __pthread_once@@GLIBC_PRIVATE instead >>> after a rebuild. That's not a step forward, I think. >> >> From nss_ldap from where exactly the __pthread_once will be originated? >> I would expect that building it against 2.34 headers to reference >> pthread_once instead. > > It's related to the in-process nature of nss_ldap (without the d), > LinuxThreads, and pthread_atfork not available in libc at the time: > > /* > * This bogosity is necessary because Linux uses different > * PIDs for different threads (like IRIX, which we don't > * support). We can tell whether we are linked against > * libpthreads by whether __pthread_once is NULL or > * not. If it is NULL, then we're not linked with the > * threading library, and we need to compare the current > * process ID against the saved one to figure out > * whether we've forked. > * > * -- > * __pthread_once does not imply __pthread_atfork being non-NULL! > * <…@redhat.com> > * -- > * > * Once we know whether we have forked or not, > * courtesy of pthread_atfork() or us checking > * ourselves, we can close the socket to the LDAP > * server to avoid leaking a socket, and reopen > * another connection. Under no circumstances do we > * wish to use the same connection, or to send an > * unbind PDU over the parents connection, as that > * will wreak all sorts of havoc or inefficiencies, > * respectively. > */ > > Of course this is all somewhat questionable, but at least there is one > historic user of that symbol. Sigh... ok. > > I think we should turn this into a compat symbol once we do not need the > internal reference (or call it by a different name instead). Agreed. > >> Right, does call pthread_once from call_once incur in a linknamespace >> issue? > > Yes, call_once is ISO C, but pthread_once is not a reserved name in > ISO C. Fair enough, the patch looks ok then.