From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id C42A13858408; Thu, 11 Nov 2021 15:33:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C42A13858408 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 1ABFWoa0014076; Thu, 11 Nov 2021 09:32:50 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 1ABFWngg014075; Thu, 11 Nov 2021 09:32:49 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 11 Nov 2021 09:32:44 -0600 From: Segher Boessenkool To: Raphael Moreira Zinsly Cc: gcc-patches@gcc.gnu.org, seurer@gcc.gnu.org, bergner@linux.ibm.com, wschmidt@linux.ibm.com, dje.gcc@gmail.com, jakub@gcc.gnu.org, tuliom@linux.ibm.com Subject: Re: [PATCH v2] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004] Message-ID: <20211111153244.GI614@gate.crashing.org> References: <20211111144010.23506-1-rzinsly@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211111144010.23506-1-rzinsly@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2021 15:33:52 -0000 Hi! On Thu, Nov 11, 2021 at 11:40:10AM -0300, Raphael Moreira Zinsly wrote: > Changes since v1: > - Removed -Wmissing-prototypes fix. > - Fixed formatting of Changelog and patch. > > --->8--- > > At the end of the backtrace stream _Unwind_Find_FDE() may not be able > to find the frame unwind info and will later call the backtrace fallback > instead of finishing. This occurs when using an old libc on ppc64 due to > dl_iterate_phdr() not being able to set the fde in the last trace. > When this occurs the cfa of the trace will be behind of context's cfa. > Also, libgo’s probestackmaps() calls the backtrace with a null pointer > and can get to the backchain fallback with the same problem, in this case > we are only interested in find a stack map, we don't need nor can do a > backchain. > _Unwind_ForcedUnwind_Phase2() can hit the same issue as it uses > uw_frame_state_for(), so we need to treat _URC_NORMAL_STOP. > > libgcc/ChangeLog: > > * config/rs6000/linux-unwind.h (ppc_backchain_fallback): Check if it's > called with a null argument or at the end of the backtrace and return. > * unwind.inc (_Unwind_ForcedUnwind_Phase2): Treat _URC_NORMAL_STOP. Committed, thanks! Please note the changelog formatting fixes I had to do, for later patches :-) Segher