From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E55BD14D29B for ; Mon, 16 Sep 2024 10:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726483060; cv=none; b=KmQEuk0rAbZLJlGIVugKJ7Ct/eWtlxtYEGqKQW15EhdQBLOBKd7GY8ZOydYuEY8XEIiAkcS/Tnr/uxzhkzKgvuwEtN4Iw/dFBiC6uVXSd7OSZ+Z3kDZyRCxrgKWTkVfIZvMBifmPaPuMuXMKWpuAaLWteAGzAvHuOxX1I5d2lPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726483060; c=relaxed/simple; bh=P2KQGR7EXPM94ax8edp9oKQsLIadoOZ/jHl07AfggfQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=u8aSm8Tg0OPk/R1Jp+9w3yRaXSlvnEYoEms0NT2aeuKftLa56msYY2SUn2UcSkQzzLj9F7DHBXtdpDHgdpjGP7LBRvOpNsF4YvlY1V11t5VzzAyFeGBjbaMAf7B10BcOdoQnHUO7yAQRSVCJvUoITtT7kPTe0IbH2b1KIjgUpCU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pi+2QqYx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pi+2QqYx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14A9BC4CEC4; Mon, 16 Sep 2024 10:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726483059; bh=P2KQGR7EXPM94ax8edp9oKQsLIadoOZ/jHl07AfggfQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pi+2QqYx84IcBorzbtI+U/xE/lGiaBgz3HVozDXG8ywM4HjoIGMaUHCKByqNljiv8 R9aOFu5QZRBHOVsS6W1MdYAxstWdYT46mKnl9DwK/JcmzHVzbq/pYzrWgY4VcDtrzq ERQqcrp3GCknXITRt7i9kvTBwBtSWSCAXJWrgnmQYBDA8vbuztic8t1auFO5mKzhB2 E3A7x2Nn55M5+OoouV/e/mQNmzn4UyLZgracF1Cyi8qURLgdUnY9R900h44dz6WmBO x3g/Zif5mySqzY46XplP0Qdc4yT2bqY60U750xV+2ejWOr6S2wBbJZgJ/0e/cqGQDf 92HGXRg36ZNiw== From: Puranjay Mohan To: Oleg Nesterov , Steven Rostedt , Masami Hiramatsu , Catalin Marinas , Will Deacon , Mark Rutland , Mark Brown , Kalesh Singh , chenqiwu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: arm64: stacktrace: WARN_ON(state->common.pc == orig_pc) in kunwind_recover_return_address() In-Reply-To: <20240916102741.GA13899@redhat.com> References: <20240916102741.GA13899@redhat.com> Date: Mon, 16 Sep 2024 10:37:31 +0000 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Oleg Nesterov writes: > I don't know the details but people report that > kunwind_recover_return_address() hits this warning. > > I know absolutely nothing about arm64 or kernel/trace/fgraph.c, but at > first glance this code looks broken: > > kunwind_recover_return_address: > > ... > > orig_pc = ftrace_graph_ret_addr(state->task, NULL, > state->common.pc, > (void *)state->common.fp); > if (WARN_ON_ONCE(state->common.pc == orig_pc)) > > ftrace_graph_ret_addr: > > ... > > if (!idx) > return ret; > > > given that kunwind_recover_return_address() passes idx == NULL to > ftrace_graph_ret_addr(), it should always return ret == state->common.pc ? > > > Perhaps this connects to 29c1c24a27 ("function_graph: Fix up ftrace_graph_ret_addr()") > and I have no idea if something like the patch below makes any sense. > Your finding is accurate. It has been fixed in upstream by c060f93253ca ("arm64: stacktrace: fix the usage of ftrace_graph_ret_addr()") See: https://elixir.bootlin.com/linux/v6.11/source/arch/arm64/kernel/stacktrace.c#L111 Thanks, Puranjay --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYKADIWIQQ3wHGvVs/5bdl78BKwwPkjG3B2nQUCZugKbBQccHVyYW5qYXlA a2VybmVsLm9yZwAKCRCwwPkjG3B2nU0XAQD2X6uLg0VyJNcwY/L5WcIDB61aPU1y mRy5eiriORWjFgEAtBeRZmqeajKlWSyUFfaNZcjqBAr6G7ndhjcujPv6KAI= =gAQR -----END PGP SIGNATURE----- --=-=-=--