Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4334880imm; Mon, 30 Jul 2018 12:41:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdKlsJM4w0OMuwV+QdWXpbeVteWD8e9dGHFILZ9ujsu+eG0abI795J8oz3kJ+MZ+bzqHykG X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr17435782plr.231.1532979713432; Mon, 30 Jul 2018 12:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532979713; cv=none; d=google.com; s=arc-20160816; b=PRfhQGCRGoc3tKvFv7vVFgSLbxtbIl73+0rznJhDbWOYBpmgcfxYOO5OFhJ18YDjgZ 8Pyh/1ge+6PDJz1MIMElhGxpe6bfpG7H70BlbWmwbmkSwh+BbHwAxyWRMpyb7N8p+iT9 5V7tVI1TN+ET/I/b0brjEFJovVeMwksqBZrIaZl0WVtb7+N1qZDsTmfK9m66lUbIuM+A HimgmbKXJ9FGQHgb7ZdTQPZfbmiMyxY+y74tEzrtGnbw8zuxYcVeqQTEIGe6ypxcHoRU 37oJXSRWPP6AnxANtSmORO7C229HKHrjHo6uxLLQsCbkT2pUdxhbJ7QgCIAPKOVHHGSB aHfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=yAdOApfNQrVefFJehkAMoE9bpWN9xAeZ5hcFxyL++qk=; b=nfNuNuoL2DIFtjUi3MFFgTqfoXOnvRpn8lc+rj5x38+2k+w8sxmYclKGnxozEX2YEz i1mFLyzf9t/HttdCEtFM1WEGFChyO+JIoxjgKF19vTQjyTUvVcuCsNu3v7DQ4dD4708r l9pbXqrHa+Aaz4FOuHVlpM4ZlF2KRvo/sn3ZJcur+JtHg1fX5obCzNReKsUxBTlnzfLa dgF/bNfoTiBaEpMVGug9EUDTHlKyDVNPO7XNzelIhB0eLiUuCph9qyoYl9r07xmIYzY+ kdIb+E5bfpBuuCDEMPyGWy8zmK79UF1i3K07JqIn+iq7XtEm58K+WDjMNtPMhI0qy4Ui RRNQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si11935756pgi.184.2018.07.30.12.41.39; Mon, 30 Jul 2018 12:41:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732034AbeG3VQh (ORCPT + 99 others); Mon, 30 Jul 2018 17:16:37 -0400 Received: from terminus.zytor.com ([198.137.202.136]:35285 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731816AbeG3VQg (ORCPT ); Mon, 30 Jul 2018 17:16:36 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6UJdrEw2423016 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jul 2018 12:39:53 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6UJdqtT2423013; Mon, 30 Jul 2018 12:39:52 -0700 Date: Mon, 30 Jul 2018 12:39:52 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: "tip-bot for Joel Fernandes (Google)" Message-ID: Cc: arnd@arndb.de, yang.shi@linux.alibaba.com, hpa@zytor.com, longman@redhat.com, tglx@linutronix.de, joel@joelfernandes.org, mingo@kernel.org, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, joel@joelfernandes.org, yang.shi@linux.alibaba.com, arnd@arndb.de, longman@redhat.com, hpa@zytor.com In-Reply-To: <20180723212531.202328-1-joel@joelfernandes.org> References: <20180723212531.202328-1-joel@joelfernandes.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/debugobjects] debugobjects: Make stack check warning more informative Git-Commit-ID: fc91a3c4c27acdca0bc13af6fbb68c35cfd519f2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_24_48 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fc91a3c4c27acdca0bc13af6fbb68c35cfd519f2 Gitweb: https://git.kernel.org/tip/fc91a3c4c27acdca0bc13af6fbb68c35cfd519f2 Author: Joel Fernandes (Google) AuthorDate: Mon, 23 Jul 2018 14:25:31 -0700 Committer: Thomas Gleixner CommitDate: Mon, 30 Jul 2018 21:36:37 +0200 debugobjects: Make stack check warning more informative While debugging an issue debugobject tracking warned about an annotation issue of an object on stack. It turned out that the issue was due to the object in concern being on a different stack which was due to another issue. Thomas suggested to print the pointers and the location of the stack for the currently running task. This helped to figure out that the object was on the wrong stack. As this is general useful information for debugging similar issues, make the error message more informative by printing the pointers. [ tglx: Massaged changelog ] Signed-off-by: Joel Fernandes (Google) Signed-off-by: Thomas Gleixner Acked-by: Waiman Long Acked-by: Yang Shi Cc: kernel-team@android.com Cc: Arnd Bergmann Cc: astrachan@google.com Link: https://lkml.kernel.org/r/20180723212531.202328-1-joel@joelfernandes.org --- 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); }