From nobody Sat Dec 25 11:55:33 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 599B618F2CC9; Sat, 25 Dec 2021 11:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JLj6t043Mz4lBc; Sat, 25 Dec 2021 11:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9869B16F03; Sat, 25 Dec 2021 11:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BPBtXTR006438; Sat, 25 Dec 2021 11:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BPBtXdi006437; Sat, 25 Dec 2021 11:55:33 GMT (envelope-from git) Date: Sat, 25 Dec 2021 11:55:33 GMT Message-Id: <202112251155.1BPBtXdi006437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 03c75960497c - stable/12 - Revert libunwind change to fix backtrace segfault on aarch64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 03c75960497c7a8aa6ff836be3a7be8a3b081d39 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640433334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E0BPMzax1BciqogbcOYqbJF8U+MDVPcTnPmfWKojrCw=; b=K//Ukx093MzSErqhPFd59EHiOtDOGhlTVhrByUHBwEGkEFVmcmCSurT5HRy0nZKFk+Cjc7 JB4fjaNHnGsplyZM2BQlKeGXSW3wvm+ncx0uYS39S1N7wSu8g2NlyYmxEmSB2DKnnqzqHl /+6hZShJKQ7xk1KNNC1dRUs7+Z0TkbHEJ8fwjtuQEHJA7nEUtLAT2CXhRE2SJUWyW2+mj4 hWWjZyQuQHNj6TIkSWRW+IR8o2RGJzLYWpxywdMxd2iRWfaBf1Wl+44Kw+M/m6vW/OR5tT sjLJIK/t/MS/NywT7O/E29fZt5uICfJfedFoO7ToWEmkEvsG0O6988roFggr3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640433334; a=rsa-sha256; cv=none; b=Ybw1vuia2eYDxbK7Oe88bsKu8bnmNNMAuZu8wCI7A3ldRVXVteUXw9UjrrXwkV5/NLK/qP ywIP+CR+856j0+Oz6TILPLwpjuekieADY6pVVlQX+wVidDGFwSdisL4Q76FqMwtJCwEKnx GwI7nKsEyJOFdGiEF9apRZfES4cAbDHQuS15ZGWYTPKO1uZMD6gXAHLNC8dk1I7O1EfjzT nSfYBpbjt2CSRf2NP6vCQTl9Nu3sCSl9i9dpjdVqSJHn/h4uNsidDObABzTNGkIl6zZPL7 Hvb4Z4of7X9wOIJvuMDyT7jmr8IpICrFXE/mCXEOWGEpy2dvFDQ9pqhnwjzexQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=03c75960497c7a8aa6ff836be3a7be8a3b081d39 commit 03c75960497c7a8aa6ff836be3a7be8a3b081d39 Author: Dimitry Andric AuthorDate: 2021-07-02 22:35:42 +0000 Commit: Dimitry Andric CommitDate: 2021-12-25 11:51:10 +0000 Revert libunwind change to fix backtrace segfault on aarch64 Revert commit 22b615a96593 from llvm git (by Daniel Kiss): [libunwind] Support for leaf function unwinding. Unwinding leaf function is useful in cases when the backtrace finds a leaf function for example when it caused a signal. This patch also add the support for the DW_CFA_undefined because it marks the end of the frames. Ryan Prichard provided code for the tests. Reviewed By: #libunwind, mstorsjo Differential Revision: https://reviews.llvm.org/D83573 Reland with limit the test to the x86_64-linux target. Bisection has shown that this particular upstream commit causes programs using backtrace(3) on aarch64 to segfault. This affects the lang/rust port, for instance. Until we can upstream to fix this problem, revert the commit for now. Reported by: mikael PR: 256864 (cherry picked from commit 5866c369e4fd917c0d456f0f10b92ee354b82279) --- contrib/llvm-project/libunwind/src/DwarfInstructions.hpp | 9 +-------- contrib/llvm-project/libunwind/src/DwarfParser.hpp | 3 +-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/contrib/llvm-project/libunwind/src/DwarfInstructions.hpp b/contrib/llvm-project/libunwind/src/DwarfInstructions.hpp index c39cabe1f783..ee98f538d437 100644 --- a/contrib/llvm-project/libunwind/src/DwarfInstructions.hpp +++ b/contrib/llvm-project/libunwind/src/DwarfInstructions.hpp @@ -93,8 +93,7 @@ typename A::pint_t DwarfInstructions::getSavedRegister( case CFI_Parser::kRegisterInRegister: return registers.getRegister((int)savedReg.value); - case CFI_Parser::kRegisterUndefined: - return 0; + case CFI_Parser::kRegisterUnused: case CFI_Parser::kRegisterOffsetFromCFA: // FIX ME @@ -118,7 +117,6 @@ double DwarfInstructions::getSavedFloatRegister( case CFI_Parser::kRegisterIsExpression: case CFI_Parser::kRegisterUnused: - case CFI_Parser::kRegisterUndefined: case CFI_Parser::kRegisterOffsetFromCFA: case CFI_Parser::kRegisterInRegister: // FIX ME @@ -142,7 +140,6 @@ v128 DwarfInstructions::getSavedVectorRegister( case CFI_Parser::kRegisterIsExpression: case CFI_Parser::kRegisterUnused: - case CFI_Parser::kRegisterUndefined: case CFI_Parser::kRegisterOffsetFromCFA: case CFI_Parser::kRegisterInRegister: // FIX ME @@ -193,10 +190,6 @@ int DwarfInstructions::stepWithDwarf(A &addressSpace, pint_t pc, prolog.savedRegisters[i])); else return UNW_EBADREG; - } else if (i == (int)cieInfo.returnAddressRegister) { - // Leaf function keeps the return address in register and there is no - // explicit intructions how to restore it. - returnAddress = registers.getRegister(cieInfo.returnAddressRegister); } } diff --git a/contrib/llvm-project/libunwind/src/DwarfParser.hpp b/contrib/llvm-project/libunwind/src/DwarfParser.hpp index de0eb6de9d70..b41cc7bcfda2 100644 --- a/contrib/llvm-project/libunwind/src/DwarfParser.hpp +++ b/contrib/llvm-project/libunwind/src/DwarfParser.hpp @@ -69,7 +69,6 @@ public: }; enum RegisterSavedWhere { kRegisterUnused, - kRegisterUndefined, kRegisterInCFA, kRegisterOffsetFromCFA, kRegisterInRegister, @@ -503,7 +502,7 @@ bool CFI_Parser::parseFDEInstructions(A &addressSpace, "malformed DW_CFA_undefined DWARF unwind, reg too big"); return false; } - results->setRegisterLocation(reg, kRegisterUndefined, initialState); + results->setRegisterLocation(reg, kRegisterUnused, initialState); _LIBUNWIND_TRACE_DWARF("DW_CFA_undefined(reg=%" PRIu64 ")\n", reg); break; case DW_CFA_same_value: