From patchwork Thu Mar 1 23:08:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 880165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-90712-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="BefEiw07"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zsp5x2N3Qz9s4r for ; Fri, 2 Mar 2018 10:09:09 +1100 (AEDT) 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:date:message-id; q=dns; s= default; b=xeJ2/6YN08B8iyDz0Xr/Tj8LvGwYwcPeEZ1b7tJmfHkjjdBt/5QmC RaFQWjfrkjTjIX5G2pRSMUnfI/KA6RaTn6njmIKkmTtoLy+fZlq3pKbNUZLTml08 81oWppcG82KmQOu1DWjCWfcgvyf0EbERDuXAo1XGCsUNxl+nPbc3FU= 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:date:message-id; s=default; bh=DBdgwvFtw9brXDcUnbLJh5V0O5U=; b=BefEiw078mm8NA8G0m0zqJ/ERvmE vkQDlOGIoCaE/KN03PVT2PSueBduRYzW+dgHEADGmD/17aDHXKHD68rnREnjQl5O o4C5KM628nP+K5IRgQaH79/XXcZpg7X45t/xpAn3brw97jbVZ8GFRfXJ/9PVlwis UBdOSdET6IZs7Mc= Received: (qmail 10039 invoked by alias); 1 Mar 2018 23:09:03 -0000 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: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 10029 invoked by uid 89); 1 Mar 2018 23:09:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=halt, H*r:120, outermost X-HELO: hall.aurel32.net From: Aurelien Jarno To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH] alpha: Add cfi information for _startcontext routines to stop unwinding [BZ#22910] Date: Fri, 2 Mar 2018 00:08:56 +0100 Message-Id: <20180301230856.18317-1-aurelien@aurel32.net> Starting with GCC 8, libgc1c is better at unwinding on alpha. This causes backtrace called within a context created by makecontext to yield infinite backtrace. This patch adds cfi information for _startcontext and ra which marks the frame as outermost frame. This fixes tst-makecontext for alpha. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/alpha/makecontext.S | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4b7e0a0261..8ea10886e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-03-01 Aurelien Jarno + + [BZ #22910] + * sysdeps/unix/sysv/linux/alpha/setcontext.S (__startcontext): Set + up CFI directive to forbid further backtracing. + 2018-03-01 Maciej W. Rozycki * nptl_db/td_ta_thr_iter.c (iterate_thread_list): Remove diff --git a/sysdeps/unix/sysv/linux/alpha/makecontext.S b/sysdeps/unix/sysv/linux/alpha/makecontext.S index cae2144e03..cc824dfe25 100644 --- a/sysdeps/unix/sysv/linux/alpha/makecontext.S +++ b/sysdeps/unix/sysv/linux/alpha/makecontext.S @@ -138,10 +138,14 @@ weak_alias (__makecontext, makecontext) .align 4 .ent __startcontext + cfi_startproc __startcontext: .frame $31, 0, $31, 0 .prologue 0 + /* Mark ra as undefined in order to stop unwinding here. */ + cfi_undefined(ra) + jsr $26, ($27), 0 ldgp $29, 0($26) mov $9, $16 @@ -160,4 +164,5 @@ __startcontext: halt + cfi_endproc .end __startcontext