Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp231667lqq; Thu, 13 Jun 2024 01:04:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZQ/PT7T3d0W2abmpQAqTk0t+NyDYTe9iysUPrix1S5qpdAjzzQ9VxerFUQPKttudlNVCzp9o+9Zs9uHILG8eZfrPruwirPyb1jBVohA== X-Google-Smtp-Source: AGHT+IFKTb437vHhCDwn7JZPrOvIMBG6SE/FKXzaU62IJQN2moUkew6t3NJjgZmTIK83lVezXR1d X-Received: by 2002:a17:902:e842:b0:1f7:1e7a:e16f with SMTP id d9443c01a7336-1f83b6ece0amr47067275ad.52.1718265848979; Thu, 13 Jun 2024 01:04:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718265848; cv=pass; d=google.com; s=arc-20160816; b=u3IwLUqX87sYnyP0KpvBdR8VhlTjJP0oN9mXEtVDLoP6Q2uOX7S3NKEONN0a/VlLKK qsWRHdoKq0Evbm/oLFhWkxL/Hfhi2Edwa55E3mvohTbv+1Op2F6ZoCFiqXpI9pvD21/s SgbtLzYVex5AoBEs2jMR3Yhh3iqNbGfh2MgcshNVsXnb/5kLC5HWhz+0F9dzcL5h5mlP Opu4WNOORsgtgjdOrV/0LMJNViyZVW71oHnVqXxEYjobPDVy62YePxCqnMXZF5TOnKni nqghWESYv0y+0p8CzsbY1JIf/Cg0RaolS7mtRYEbnHsnYrA0R+Pz1KOwsUba1cLALLUj AGig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=4lM83IWwh2VbLqKmQaNYtAMo8vBQQpf/F1x4aBeU7dk=; fh=YHZ3df9DL+WaHfB9ACwcBdQ5XFgfGIYzWfQccR88Xhk=; b=LnDFxfNk1datCFd65aCXEUNgyBf4sNOJq/kvqMK21FATsFOlAmdo5iygQz/UGqHHKh ZFX0BGmqnRKcrp4ohQbUsa/tiFFya7BPntTDvQt5SAfQXkPiz9Qf82cNWbA3PA8Ci5AC hqEzm63yKe37+6UuIsuGmDmx1BeVQ93Qc9cuRONGMrAyyAVZx9q1PL7saMVcjJgzK2FF DM9wJcP7ZM+/NVdl5qFunebkJv8ysFybYBTI/fuD3ua8nB/QzVvCxgDyoV/aAYHSMAWs FIRpv0DWLJOWOdqHo7k5SLp2qyxDZJNRNwdzJA3d5pB1Wb3eID8SZFsCgaP7v9vJnNfQ EhbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RHafRWEV; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-212770-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212770-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f855eca980si8093365ad.205.2024.06.13.01.04.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 01:04:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212770-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RHafRWEV; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-212770-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212770-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 58404B23B6B for ; Thu, 13 Jun 2024 08:00:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E43A13C910; Thu, 13 Jun 2024 08:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RHafRWEV" Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30CBD13CA87 for ; Thu, 13 Jun 2024 08:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718265612; cv=none; b=Di9nHKVClkzcbUvoFx2aTEQz5UPGzFXawhcaPkDFFFQ0A9XMdABc2yT0Dl4PWaC9QVtgN27B/XjhjPQefTPIwoWYZsVKmcu73TxOdNFwKnxwbI9GdBCdaHC8FcMfMQYVJVG1YVstJFbUMoXWhFOg6KsQRKlHcw09PruzRh7qcS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718265612; c=relaxed/simple; bh=aP1VI8hpnO5c/PN7JVXiD6QGSaUwXPkX1stVwfI+GHU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=p9vROWY8Nh+OlV1we6xBouf/hRHA9y49nxVyoj4I30NHfyxAirqtzD++tTBB8ws2G0E2eApV/g6Mq6ZE+0chwIxneulwQbS3J/IOkecA7yGVqryajoCe8/f51NNDQmf7l6ENG+UE/5VWBc+ut64PC2jIOdSkZdbUHFc4Mqi2bdY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RHafRWEV; arc=none smtp.client-ip=209.85.217.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-vs1-f44.google.com with SMTP id ada2fe7eead31-48d7a81a594so298943137.2 for ; Thu, 13 Jun 2024 01:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718265610; x=1718870410; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4lM83IWwh2VbLqKmQaNYtAMo8vBQQpf/F1x4aBeU7dk=; b=RHafRWEVTpVa7IxhdKkF0S26sKFMjpf7QTYAS0jtrqKiUqsHIpBx7RueJt0DfXhktN z6Kuf34NHPd9yG1RxmmeS9yDwiO7GE4Jyes64KnaiMFlUmVSvXGN756ijffhrZ/WguEg +tBphioowjkJuB9oZs+wVOmaDN0w3QNJyaO8lBp6fayJdLQsE4TNi3LtTCJF/oc/+pJu V/IBo8lgl7xx63gK3wfiVSeGKduziY33PWk0b9VTdeJp9ZY9W/c3Pz4GBuArR+/SnALt +WsA/Fo3JWT0E4RDzqr364biWnB3/ReNIMkl4p2OOl0ptsP8mIJ3pfU4fBOSqEIEq3Cg sOaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718265610; x=1718870410; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4lM83IWwh2VbLqKmQaNYtAMo8vBQQpf/F1x4aBeU7dk=; b=aslLv6YDhQVOYnIsYNegs2bTTOW1S3P+I00E+P6qDcjk8RSyGYPAHjmGFKCuL+FsWK mC/r/KDNES/7/lmogiIVBYDhYtvlTap02L53ZPmW4wGZj7b8K/OD2XvOhulf1MQv9O3W u8tu3JBAzYF0PEf7FMPP7H7QV3np4ej25hoSMbP4MlPJ+jC6/S/kC5A5JjoQjk4FXf3M 0bIFJEryX9p5bKhKEx3mMbRj/trQtVrKrTp0q/OSDWP3UwpSet+brRFUVrxaW1QLbrkT GFrl8iw846ECwqIUuyBz5Z2LiFAkr/CqGxXGup7gE05cmymn6v4jqp+W47BJIn+RTwHE ZSSg== X-Gm-Message-State: AOJu0YzSD/U+TnByanhlhZ4LfcPtbz9axWlztruSzT2kjJuFTjAHYjfw LKBv4v+NogAk+/odA3QnHg2qG5dQ0BOsuALP3aZmlkDobHir6RXIBXMyDBn39Frj86shGjIRWYT HBS9rdd+BGBnYQERzfSKd1vbQ8+1cX2hjQUjisA== X-Received: by 2002:a05:6102:2cb:b0:48c:47c3:7857 with SMTP id ada2fe7eead31-48d91e6b719mr4159186137.29.1718265610035; Thu, 13 Jun 2024 01:00:10 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240612125130.2c1d6d2d@rorschach.local.home> <20240612171748.0bc6d9cb@rorschach.local.home> In-Reply-To: <20240612171748.0bc6d9cb@rorschach.local.home> From: Naresh Kamboju Date: Thu, 13 Jun 2024 13:29:58 +0530 Message-ID: Subject: Re: LTP tracing crashed on arm64 rk3399-rock-pi-4 - pc : ftrace_ops_test To: Steven Rostedt Cc: open list , lkft-triage@lists.linaro.org, Linux Regressions , Dan Carpenter , Arnd Bergmann , Masami Hiramatsu , Mark Rutland Content-Type: text/plain; charset="UTF-8" On Thu, 13 Jun 2024 at 02:47, Steven Rostedt wrote: > > On Wed, 12 Jun 2024 12:51:30 -0400 > Steven Rostedt wrote: > > > > [ 100.600222] Hardware name: Radxa ROCK Pi 4B (DT) > > > [ 100.600229] pstate: 800003c5 (Nzcv DAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) > > > [ 100.600239] pc : ftrace_ops_test+0x34/0x138 > > > > Hmm, could you show the exact line of the above code? Specifically we have: > > > > rcu_assign_pointer(hash.filter_hash, ops->func_hash->filter_hash); > > rcu_assign_pointer(hash.notrace_hash, ops->func_hash->notrace_hash); > > > > Hmm, it's a NULL pointer dereference at 0x8, so ops is likely not NULL, > > as func_hash is much farther down. But if func_hash is NULL, > > filter_hash is at the 0x8 offset. > > > > So now the question is, how did func_hash become NULL. It should always > > be pointing at something. May have to do with the subops. Will investigate. > > > > > > > > > > [ 100.600258] lr : function_graph_enter+0x144/0x208 > > I wonder if we need the following patch: > > diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c > index 8317d1a7f43a..fc205ad167a9 100644 > --- a/kernel/trace/fgraph.c > +++ b/kernel/trace/fgraph.c > @@ -641,7 +641,7 @@ int function_graph_enter(unsigned long ret, unsigned long func, > { > for_each_set_bit(i, &fgraph_array_bitmask, > sizeof(fgraph_array_bitmask) * BITS_PER_BYTE) { > - struct fgraph_ops *gops = fgraph_array[i]; > + struct fgraph_ops *gops = READ_ONCE(fgraph_array[i]); > int save_curr_ret_stack; > > if (gops == &fgraph_stub) > > > Because if the compiler decides to re-read gops from fgraph_array[i] after the > above check for the following line that does: > > save_curr_ret_stack = current->curr_ret_stack; > if (ftrace_ops_test(&gops->ops, func, NULL) && > gops->entryfunc(&trace, gops)) > bitmap |= BIT(i); > > > and gops now points to fgraph_stub, it will trigger this bug. > > Can you apply the above change and see if the bug goes away? I will apply this patch and run the test in a loop. Since it is only seen once. Not sure I could validate this and confirm. > > Thanks, > > -- Steve - Naresh