From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80020C5478C for ; Tue, 27 Feb 2024 14:17:25 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Tkfh41p44z3vf5 for ; Wed, 28 Feb 2024 01:17:24 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=srs0=u1u6=ke=goodmis.org=rostedt@kernel.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Tkfgb2C7Cz3dRp for ; Wed, 28 Feb 2024 01:16:59 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 697D261241; Tue, 27 Feb 2024 14:16:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC338C433F1; Tue, 27 Feb 2024 14:16:56 +0000 (UTC) Date: Tue, 27 Feb 2024 09:18:58 -0500 From: Steven Rostedt To: Sachin Sant Subject: Re: Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests Message-ID: <20240227091858.7b66f8cc@gandalf.local.home> In-Reply-To: <129D90CC-6DEB-4953-8061-EAA89F1ED514@linux.ibm.com> References: <20240226122208.344447f1@gandalf.local.home> <129D90CC-6DEB-4953-8061-EAA89F1ED514@linux.ibm.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 27 Feb 2024 15:06:18 +0530 Sachin Sant wrote: > I used this setup to again run bisect between 6.7.0 and 6.8-rc1. > Bisect points to following patch > > commit 8ec90be7f15fac42992ea821be929d3b06cd0fd9 > tracing: Allow for max buffer data size trace_marker writes Thanks, that was what I was looking for. Hmm, can you send me your config. One thing that powerpc architecture has different is that the page size can be much larger, and the calculations are based off of that. Can you try this patch and see if it triggers? Thanks, -- Steve diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 3e7fa44dc2b2..c3dba537f342 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -1589,6 +1589,9 @@ static enum print_line_t trace_print_print(struct trace_iterator *iter, struct trace_seq *s = &iter->seq; int max = iter->ent_size - offsetof(struct print_entry, buf); + if (WARN_ON_ONCE(max < 0)) + return TRACE_TYPE_UNHANDLED; + trace_assign_type(field, iter->ent); seq_print_ip_sym(s, field->ip, flags);