From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Florian Weimer Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: [PATCH 3/3] Refactor atfork handlers Date: Tue, 20 Feb 2018 14:42:35 +0100 Message-ID: References: <1518008967-8310-1-git-send-email-adhemerval.zanella@linaro.org> <1518008967-8310-3-git-send-email-adhemerval.zanella@linaro.org> <88a58530-092d-4daa-1096-97a1bf8e08ff@redhat.com> <7b71dd04-afd0-9ff0-79c3-3d47cbd77ee2@redhat.com> <4aad8145-b06f-4d95-315a-73d5f2253971@linaro.org> <9d8251a8-7604-9846-ebde-409786e2ebf4@redhat.com> <780cefa6-543f-1a04-4b4e-9059a30d211b@linaro.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519134043 18170 195.159.176.226 (20 Feb 2018 13:40:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Feb 2018 13:40:43 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: libc-alpha@sourceware.org To: Adhemerval Zanella Original-X-From: libc-alpha-return-90404-glibc-alpha=m.gmane.org@sourceware.org Tue Feb 20 14:40:39 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=XiwRYK09hMQ9uAsD tsBerlJFYa21Fq+JdqFBFHVv600JinbG4BM+sofyeErJKzmr/KpKH0onJCz6iMh5 zgRnK+ekSMRzjUzuzBFSfV+8psfONb5x8AfpSnzRVyuXxaznVVxYQUGCN10X82G+ s0fw8r/uz4pg1ZLHGEdSOZIJ9SY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=8TLUoR2VrvkyYNCx29N/Zo 5N38k=; b=FAdnFIU/jk9s2BO2s8Iw9EmAETu7Dsf4QSwomWpM5m4uh/MuiZb3e8 eVPNpFeNB5mINb36I/mGuipjU5P59wEIGHORwAwvCGeJppJVRKDfJJLS1d8nBaPy l4TEniwEP7YpG2bD5kjuNtKhaHy18xaoDdr53AstpvffKFgmbYj0w= Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com In-Reply-To: <780cefa6-543f-1a04-4b4e-9059a30d211b@linaro.org> Xref: news.gmane.org gmane.comp.lib.glibc.alpha:82736 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eo89s-0004Hq-Fx for glibc-alpha@blaine.gmane.org; Tue, 20 Feb 2018 14:40:36 +0100 Received: (qmail 48095 invoked by alias); 20 Feb 2018 13:42:39 -0000 Received: (qmail 48086 invoked by uid 89); 20 Feb 2018 13:42:39 -0000 On 02/20/2018 02:27 PM, Adhemerval Zanella wrote: > I think it might occur with proposed implementation only if a callback tries to call > pthread_atfork or fork itself. It these scenario you have in mind? And should we > really support them if this is the case? No. __libc_fork starts like this: bool multiple_threads = THREAD_GETMEM (THREAD_SELF, header.multiple_threads); __run_fork_handlers (atfork_run_prepare); And then acquires _IO_list_lock. I don't see anything which prevents concurrent registration of additional fork handlers between the first and second call to __run_fork_handlers. As I said, that shouldn't prevent inclusion of the current patch, but we need to fix this before 2.28, I think. Thanks, Florian