From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36133 invoked by alias); 26 Jun 2018 11:15:52 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 35952 invoked by uid 89); 26 Jun 2018 11:15:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:7ada549, approaching, longjmp, it.=c2?= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 3 recipients X-HELO: mail-yw0-f182.google.com Received: from mail-yw0-f182.google.com (HELO mail-yw0-f182.google.com) (209.85.161.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Jun 2018 11:15:43 +0000 Received: by mail-yw0-f182.google.com with SMTP id n187-v6so2452908ywd.1; Tue, 26 Jun 2018 04:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=W6qAA5Om4+yqbNJg/gNsc5+ANNUDGKX9YNb9VOuQOb8=; b=RptnEk4sXfh5V+IDwyfVJk/bxtY+/bMplccS2Pj/9Di5a3YyvzY/4evBvZI4ZPRNye LxPcI+AieuKH1VicMuqmeCgRkKWPj80oTRiyANeC3VmCy2AAp8Na9Z+Q3nezpO2AWRJy Mtpcjvza/oZdOtTmInOFSM/CvWSEqi71bKQxG4lXmR/CkD+3TgNfV1UMLc0y+OibuT7q lcLTKOa3k1NwxcuC0v1wUoPcXGqdKqNtd3NQUudPXXdHfcYnvP4s5kJRsGGc8wH9eBf7 UvWzBHOJXFN5FRufOBr1IloCbz7g+C/dhOv13f5wnC3/u9ZIYzQSAE09rLsod4eNZ5sQ vJ+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=W6qAA5Om4+yqbNJg/gNsc5+ANNUDGKX9YNb9VOuQOb8=; b=NFDPPd9tTbmTm9foiPpW58fhQL8Zuvbj4WHWOmXipErrUgDm7casghUOVORrPSkOSv z7ar9vbuzYbTg/oBseZBQWnpfL3CoFF7NtUanfKNnyAcRwwsUJp+KCMs17Nr9grgiadU Li3GJnpMcMPuXIckNpzpT92it8ILB7VG610E//Z/0gwNlnwgFEHGaq1WlQP72hi4Odq/ tNxuiL3z6XFjnEniltai+EUFDNSxkdx03Wb16nZBuf6qRVKHfOnWUIYURsrXZAElMivQ UaNtkWgMUgrJfo9GxeYH+jC036D1PrUS/1lwjpO07RTXrSZfcEABhjwXViCNOatV/5LZ lKmg== X-Gm-Message-State: APt69E2RPHDHzOchXYQGPU3CnWyV32D6BGNnFbs2R3fypjiEB6z4CwOH 6EW/lIdqDN61NQBiVSegi9Y= X-Google-Smtp-Source: AAOMgpefS2KPcRor+GAZ+uJ6Wu6tHe4SW3q9q/IYNmQZQOry5lN9Novhfx9odvVe+Z0fJF2sqBdGkg== X-Received: by 2002:a81:98ca:: with SMTP id p193-v6mr475869ywg.380.1530011741294; Tue, 26 Jun 2018 04:15:41 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::3:52b6]) by smtp.googlemail.com with ESMTPSA id p81-v6sm470590ywb.71.2018.06.26.04.15.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 04:15:40 -0700 (PDT) Subject: Re: Invalid program counters and unwinding To: Florian Weimer , GCC , GNU C Library , Binutils , gnu-gabi@sourceware.org References: <7ada5491-f3f4-e048-dfec-6e51cd937163@acm.org> <0c58f1bb-220c-d03d-7375-6066fb7d53e6@redhat.com> From: Nathan Sidwell Message-ID: <0b0e49f0-7ed0-aa4e-a4df-d4286206dab5@acm.org> Date: Mon, 01 Jan 2018 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <0c58f1bb-220c-d03d-7375-6066fb7d53e6@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SW-Source: 2018-q2/txt/msg00017.txt.bz2 On 06/26/2018 07:01 AM, Florian Weimer wrote: > On 06/26/2018 12:56 PM, Nathan Sidwell wrote: >> On 06/26/2018 05:26 AM, Florian Weimer wrote: >> >>> So it looks to me that the caller of _Unwind_Find_FDE needs to ensure >>> that the PC is a valid element of the call stack.  Is this a correct >>> assumption? >> >> I thought this was an (implicit?) requirement. You're unwinding a >> stack to deliver an exception up it.  Are there use cases where that >> is not the case? > > We have something approaching this scenario. > > pthread_cancel in glibc unwinds the stack using DWARF information until > encounters a frame without unwind information, when it switches to > longjmp to get past that obstacle. This is a long jump to the originating pthread function at the end of the stack, right? We not only get past the obstacle, but any and all DWARF frames on top of it. (just for my understanding) > However, at the point of transition from a valid DWARF frame into the > wilderness (without unwind data), we should still have accurate > information on the caller's PC, so _Unwind_Find_FDE will reliably fail > to find any unwind data for it.  It's not a random pointer somewhere > else, so I think even the pthread_cancel case is fully supported. That sounds right. It's a PC that you could return to if you weren't trying to unwind the stack. nathan -- Nathan Sidwell