Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6393625imm; Mon, 23 Jul 2018 17:34:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpce6JQ/gGwCaRfCaAvLwdQsc0pPAFpOH+CMrGsMXZDBKfvoW+BCQB/EX65F4CyChs4pBgCu X-Received: by 2002:a62:3c4f:: with SMTP id j76-v6mr15424901pfa.119.1532392492674; Mon, 23 Jul 2018 17:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532392492; cv=none; d=google.com; s=arc-20160816; b=Sut/nqLe9Zc5MCl8KXAJZkAlL4ivM2c1VMyBgfzJJCVxu6ID46MI6HVCHRHjl6ABei 0k5GNO1QDlTLmbSwXPS+4rwiWzoODBD0+3HB4bH8PUzKCnwsu+UosCSFeinSWH2YNy26 gh+NtuOosERDAqOTFYhGOXoneO8Owjk/quWwbAQ12rAbZJDEoXblLdm53rGDib4nJWmF 60mm7/zBka7XuDWzV6XVau6Frw6mPe72XFybzCqgdIRIOVtuz5CNeke0qFBFMvWMbrVT Js/UOjs8KVgpfP9E6q4idg402CV4v9ihYmCbO5sLSq/PRh9n8a6Il1BcZ8my7refWKpq eeqg== 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:organization:from:references:cc:to:subject :arc-authentication-results; bh=kG499X8VxKx1hv1bkt3tvc2N9VBXn/WDq+hofHZcs3U=; b=P/ChV4Gd/092gqp1t0VoZWCuM3YwghAo7WlyCN+Byfaacd+DqNWAsiZ2FiwZGLj+dk fBYEiXrSdr3VUch+lIYz/leP6Il1LtHtucCJRiO9lmaV/G7XWnOTeEZgKd6aAztjZaPs 4JscuXH988vIL/qob80PRPASbxynvyxHoLk8Rwz2gxwnMBd/NqJ+/h812xSlqZajJGsx 7VB53up3M3SKNUu26zmHaJlUsF5kNjW96g0ivG7FiRs0XMG5vmrWjSn7jSZWLTqsIAqG akeplRLdAPyhfbTbLuPxYPHKn1KEYsMSdZdeKvP258ftZA5hgmm9dRe3ISwb2uXUON0j Kk0g== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s64-v6si10117954pfg.175.2018.07.23.17.34.37; Mon, 23 Jul 2018 17:34:52 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388231AbeGXBhg (ORCPT + 99 others); Mon, 23 Jul 2018 21:37:36 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42744 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388181AbeGXBhf (ORCPT ); Mon, 23 Jul 2018 21:37:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2C154023336; Tue, 24 Jul 2018 00:33:49 +0000 (UTC) Received: from llong.remote.csb (ovpn-121-66.rdu2.redhat.com [10.10.121.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35A787C57; Tue, 24 Jul 2018 00:33:48 +0000 (UTC) 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 , Yang Shi , Arnd Bergmann , astrachan@google.com References: <20180723212531.202328-1-joel@joelfernandes.org> From: Waiman Long Organization: Red Hat Message-ID: Date: Mon, 23 Jul 2018 20:33:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180723212531.202328-1-joel@joelfernandes.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 24 Jul 2018 00:33:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 24 Jul 2018 00:33:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/23/2018 05: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. > > 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); > } > Acked-by: Waiman Long