Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6277206imm; Mon, 23 Jul 2018 14:57:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdE+2OHdFfwBLAGrGMJeAoaPmFeIYV8cTBZubv8tDPpb4Zh8DaS/UauFf6JGtlcexmt0341 X-Received: by 2002:a62:c0a:: with SMTP id u10-v6mr14847538pfi.43.1532383052188; Mon, 23 Jul 2018 14:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532383052; cv=none; d=google.com; s=arc-20160816; b=Vi46z0bFvvfnXjMmUJKyXVz02LL1BKQBaCM5l7v7BknwG38ErAXXTvzZPpUWUqEKm8 Ryr3z2RSdpLq7leM/1/FBa27BZY8b5pZWGz6M+wAXlxAM2jchYbmcf/W6iPJ8EJZrOWq 8b3F2jIKEnAkG82To6OfKu6uQvlmrPf9V/A+GGeoqeg9mu8KhnkwbXMx6d6egLnf4dri osW3IVKVpDlXjKhuZckWF2nSh2CUtDJrOauu5dw+6I/XLLMwJc41GYXJi4Fg956EiItp OL8xONffCZQl7HJCCUwC1uNpzQ9Ccsb6YOzrZkBySK2YuKnu0Z8f6L1W5KLU5QhrE/xj WI5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=athttRx4ZklHFBcgyQcQZbGShhyU0X0I/J38t/lJrdY=; b=mOIBKoQIoS+A1XoTSQTVaRLEqhcBqeB2MKvttPSwz4clTvh3TDnCqlTK6CpVkxKD+d sw5pjSG3qRZi9J3KHxh04aTRll99GvgvhPAHSahQgZFsjUPuOxG3M/DHseerHD6gu11i 4UfDPdQ/zrayXfB9wXzVKXFh04PdqM6CYub633H0d82FVc1LUnrJbyP3DaeBj0Jknloo WcfAH3o3dYfmZKe7XfzgQJlxTnnz1iX5hOgMj496hmdvUp7uKFKpHwTuNTVakwe0kkiL mmCWPpHGK6qn7EPMF4AdCkN/n1CElD2r3bsX+6qChHHPMpBXmklg6IT6frLxe3uSyr7Q O71w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j63-v6si8721575pgd.425.2018.07.23.14.57.17; Mon, 23 Jul 2018 14:57:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388266AbeGWW6c (ORCPT + 99 others); Mon, 23 Jul 2018 18:58:32 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:59802 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388131AbeGWW6c (ORCPT ); Mon, 23 Jul 2018 18:58:32 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0T5BkFTc_1532382910; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T5BkFTc_1532382910) by smtp.aliyun-inc.com(127.0.0.1); Tue, 24 Jul 2018 05:55:12 +0800 Subject: Re: [PATCH RFC] debugobjects: Make stack check warning more informative To: Joel Fernandes , linux-kernel@vger.kernel.org Cc: kernel-team@android.com, Thomas Gleixner , Waiman Long , Arnd Bergmann , astrachan@google.com References: <20180723212531.202328-1-joel@joelfernandes.org> From: Yang Shi Message-ID: Date: Mon, 23 Jul 2018 14:54:57 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180723212531.202328-1-joel@joelfernandes.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/23/18 2:25 PM, Joel Fernandes wrote: > From: "Joel Fernandes (Google)" > > Recently we debugged an issue where debugobject tracking was telling > us of an annotation issue. Turns out the issue was due to the object in > concern being on a different stack which was due to another issue. > > Discussing with tglx, he suggested printing the pointers and the > location of the stack for the currently running task. This helped find > the object was on the wrong stack. I turned the resulting patch into > something upstreamable, so that the error message is more informative > and can help in debugging for similar issues in the future. Acked-by: Yang Shi > > Signed-off-by: Joel Fernandes (Google) > --- > lib/debugobjects.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/lib/debugobjects.c b/lib/debugobjects.c > index 994be4805cec..24c1df0d7466 100644 > --- a/lib/debugobjects.c > +++ b/lib/debugobjects.c > @@ -360,9 +360,12 @@ static void debug_object_is_on_stack(void *addr, int onstack) > > limit++; > if (is_on_stack) > - pr_warn("object is on stack, but not annotated\n"); > + pr_warn("object %p is on stack %p, but NOT annotated.\n", addr, > + task_stack_page(current)); > else > - pr_warn("object is not on stack, but annotated\n"); > + pr_warn("object %p is NOT on stack %p, but annotated.\n", addr, > + task_stack_page(current)); > + > WARN_ON(1); > } >