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 0/2] nptl: Update struct pthread_unwind_buf Date: Sun, 25 Feb 2018 15:13:50 +0100 Message-ID: <87po4t9mxt.fsf@mid.deneb.enyo.de> References: <20180201205757.51911-1-hjl.tools@gmail.com> <2a02aac9-6aa3-4dc6-b122-039ae85365e8@redhat.com> <87d11emoap.fsf@mid.deneb.enyo.de> <878tc2mkgr.fsf@mid.deneb.enyo.de> <90d3ee18-c292-117f-a0c1-7822e340ca02@redhat.com> <87a7vyjsqv.fsf@mid.deneb.enyo.de> <87vaelbetu.fsf@mid.deneb.enyo.de> <87fu5pb7ql.fsf@mid.deneb.enyo.de> <877er1b4zp.fsf@mid.deneb.enyo.de> <87371pb3ga.fsf@mid.deneb.enyo.de> <87tvu59o21.fsf@mid.deneb.enyo.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1519567919 3051 195.159.176.226 (25 Feb 2018 14:11:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Feb 2018 14:11:59 +0000 (UTC) Cc: "Carlos O'Donell" , GNU C Library To: "H.J. Lu" Original-X-From: libc-alpha-return-90568-glibc-alpha=m.gmane.org@sourceware.org Sun Feb 25 15:11:54 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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=hLd7z D+0yLyRoMvjblS+zN74iiXEbBHTX3QWoo7MQO1QCzIOXZN2AN/ulBvI3MitUTuna U3S5bB1TArkUa6ZQtyRZnjXlPZc61d+bfuqnsFetbegXsNFmgUoUarF5xMkzLmV4 xF3wlPwNIF3Uy95oEtGld5fI/drpCJ/k+VEmbM= 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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=mYo2OvOthch VXEoOb5IIxrwGj28=; b=ppkqxPP6hqsDfiVcGE/QoiarhAQKeuuAAKHw3DhGCKf m14uOdD83X/XRrcXxyYLMbaM9UgOneDyNeXV6QIwxrEs3VVcFa3vraNUvp+SweGo dtvcxbtScSvxnEx4UnC/p1d1sqG/H0theaXoKRzFPB9NYoYeXPWNJT9wyEgoFqVg = 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=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: albireo.enyo.de In-Reply-To: (H. J. Lu's message of "Sun, 25 Feb 2018 06:00:16 -0800") Xref: news.gmane.org gmane.comp.lib.glibc.alpha:82900 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 1epx1t-0000PY-LJ for glibc-alpha@blaine.gmane.org; Sun, 25 Feb 2018 15:11:54 +0100 Received: (qmail 93649 invoked by alias); 25 Feb 2018 14:13:56 -0000 Received: (qmail 93526 invoked by uid 89); 25 Feb 2018 14:13:55 -0000 * H. J. Lu: > On Sun, Feb 25, 2018 at 5:49 AM, Florian Weimer wrote: >> * H. J. Lu: >> >>> On Sun, Feb 25, 2018 at 5:31 AM, Florian Weimer wrote: >>>> * H. J. Lu: >>>> >>>>> libpthread cancellation implementation passes cancel_jmp_buf to >>>>> libgcc unwinder, >>>> >>>> Oh. Where does it do that? If you mean _Unwind_ForcedUnwind, I think >>>> that's just an opaque closure argument for the callback. >>> >>> Yes. Libgcc unwinder needs to deal with it. >> >> Please point me to the code. Thanks. > > sysdeps/nptl/unwind-forcedunwind.c has > > _Unwind_Reason_Code > _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, > void *stop_argument) > { > if (__glibc_unlikely (libgcc_s_handle == NULL)) > pthread_cancel_init (); > else > atomic_read_barrier (); > > _Unwind_Reason_Code (*forcedunwind) > (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *) > = libgcc_s_forcedunwind; > PTR_DEMANGLE (forcedunwind); > return forcedunwind (exc, stop, stop_argument); > } Thanks. I think stop_argument ends up in the private_2 member inside unwind.inc, which is only passed back to the callback (the stop function pointer) in _Unwind_ForcedUnwind_Phase2, and not interpreted by libgcc itself. So this shouldn't be a problem.