From: Puranjay Mohan <puranjay@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mark Brown <broonie@kernel.org>,
Kalesh Singh <kaleshsingh@google.com>,
chenqiwu <qiwuchen55@gmail.com>
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()
Date: Mon, 16 Sep 2024 10:37:31 +0000 [thread overview]
Message-ID: <mb61pmsk7natw.fsf@kernel.org> (raw)
In-Reply-To: <20240916102741.GA13899@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]
Oleg Nesterov <oleg@redhat.com> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]
next prev parent reply other threads:[~2024-09-16 10:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 10:27 arm64: stacktrace: WARN_ON(state->common.pc == orig_pc) in kunwind_recover_return_address() Oleg Nesterov
2024-09-16 10:37 ` Puranjay Mohan [this message]
2024-09-16 14:18 ` Oleg Nesterov
2024-09-16 10:38 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mb61pmsk7natw.fsf@kernel.org \
--to=puranjay@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=kaleshsingh@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=oleg@redhat.com \
--cc=qiwuchen55@gmail.com \
--cc=rostedt@goodmis.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.