From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by sourceware.org (Postfix) with ESMTPS id 04C073850404 for ; Wed, 2 Jun 2021 13:14:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 04C073850404 Received: by mail-qv1-xf2b.google.com with SMTP id im10so386431qvb.3 for ; Wed, 02 Jun 2021 06:14:44 -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:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zTl3uZVAcHPYrwVH4td9JjYcbY7C2MGsk/JN5mBdZl8=; b=KhanISfREU4flmQXEqFHFBiPT29WkT4M1RoVmWk2Kg9L9qK+KqfiV0LVqjCp95O7vW nFW04aAXoHJ1KgnzKRrhVQGw3PqEqb0zc+OGM/xWhBnezjbUPo8TSCspjT4sdwDrnWBR Weddc0JZ2OMOWmIu0VtgypBOYx0nnB4ptHk9b7/kchf3JeRmk2TXn/yIJNKFwjirWmQi ReehJ7MwNA9oxdMozYV9R0NB1EhsFcSkIVvd5k6/02Y4CIg0e9fBZGQ8zjFVBOy1hcbs gAeSx1sCZps3stdmuAeJ0j0KPYKBsDnxJSBZarxgJV5WBuaXXtxKQpdI0Kt3CLsO+U1R f9dA== X-Gm-Message-State: AOAM531dlhb28uYF+o8jkVyTofZHYvKv5zSqeFY3iwU5nkEnR+VxdZiC G4cjDdWcqX8apjqRbWHoV+GbPzpqx+MSLg== X-Google-Smtp-Source: ABdhPJwr3J6MPuTXuoEmiJV3LtOhIW5GJndQCUAtOMrSpL1mBdhup3kNDVsN9xVp5hs9g4lThoiI8Q== X-Received: by 2002:a0c:ec08:: with SMTP id y8mr8454385qvo.35.1622639683538; Wed, 02 Jun 2021 06:14:43 -0700 (PDT) Received: from [192.168.1.4] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id i14sm14103638qkn.99.2021.06.02.06.14.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 06:14:43 -0700 (PDT) Subject: Re: [PATCH v2 7/9] nptl: Implement raise in terms of pthread_kill To: Florian Weimer , Adhemerval Zanella via Libc-alpha References: <20210527172823.3461314-1-adhemerval.zanella@linaro.org> <20210527172823.3461314-8-adhemerval.zanella@linaro.org> <87k0nd69n3.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <4d1728fc-27f1-1d60-30b6-66ad5977798c@linaro.org> Date: Wed, 2 Jun 2021 10:14:41 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <87k0nd69n3.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 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, 02 Jun 2021 13:14:54 -0000 On 01/06/2021 09:40, Florian Weimer wrote: > * Adhemerval Zanella via Libc-alpha: > >> For Linux implementation, pthread_kill read the targeting TID from >> the TCB. For raise, this it not possible because it would make raise >> fail when issue after vfork (where creates the resulting process >> has a different TID from the parent, but its TCB is not updated as >> for pthread_create). To make raise use pthread_kill, it is make >> usable from vfork by getting the target thread id through gettid >> syscall. > > Please add the vfork information as a comment in pthread_kill. > Otherwise looks good. I added the following comment: if (pd == THREAD_SELF) /* It is a special case to handle raise() implementation after a vfork call (which does not update the PD tid field). */ tid = INLINE_SYSCALL_CALL (gettid);