From patchwork Wed Sep 25 21:58:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 2944731 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 894179F3C4 for ; Wed, 25 Sep 2013 21:58:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 663C820306 for ; Wed, 25 Sep 2013 21:58:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80BF320316 for ; Wed, 25 Sep 2013 21:58:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754205Ab3IYV6M (ORCPT ); Wed, 25 Sep 2013 17:58:12 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50538 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754133Ab3IYV6M (ORCPT ); Wed, 25 Sep 2013 17:58:12 -0400 Received: from mfilter4-d.gandi.net (mfilter4-d.gandi.net [217.70.178.134]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id EDC86172089; Wed, 25 Sep 2013 23:58:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter4-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter4-d.gandi.net (mfilter4-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 5NjUl6HQbPp5; Wed, 25 Sep 2013 23:58:09 +0200 (CEST) X-Originating-IP: 173.246.103.110 Received: from jtriplet-mobl1 (joshtriplett.org [173.246.103.110]) (Authenticated sender: josh@joshtriplett.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 60BCD17207C; Wed, 25 Sep 2013 23:58:07 +0200 (CEST) Date: Wed, 25 Sep 2013 14:58:05 -0700 From: Josh Triplett To: Peter Zijlstra Cc: kbuild test robot , Ingo Molnar , kbuild-all@01.org, linux-sparse@vger.kernel.org, sparse@chrisli.org Subject: Re: [tip:sched/core 16/27] fs/jbd/commit.c:105:12: sparse: context imbalance in 'inverted_lock' - wrong count at exit Message-ID: <20130925215805.GB7716@jtriplet-mobl1> References: <52432bed.WfPoNUw4qxmYeQy4%fengguang.wu@intel.com> <20130925185925.GD3657@laptop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130925185925.GD3657@laptop.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Sep 25, 2013 at 08:59:25PM +0200, Peter Zijlstra wrote: > On Thu, Sep 26, 2013 at 02:31:09AM +0800, kbuild test robot wrote: > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core > > head: 1a338ac32ca630f67df25b4a16436cccc314e997 > > commit: 0c44c2d0f459cd7e275242b72f500137c4fa834d [16/27] x86: Use asm goto to implement better modify_and_test() functions > > reproduce: make C=1 CF=-D__CHECK_ENDIAN__ > > > > > > sparse warnings: (new ones prefixed by >>) > > > > >> drivers/infiniband/hw/qib/qib_verbs.h:1061:36: sparse: crazy programmer This one, by the way, seems like a sparse internal error, which ought to have a better message. The patch below does that; Chris, does this patch seem reasonable to you? (The message itself might need accuracy improvements; it's still pretty vague about what went wrong.) ---8<--- From: Josh Triplett Date: Wed, 25 Sep 2013 14:55:44 -0700 Subject: [PATCH] Change "crazy programmer" into a proper internal error message Signed-off-by: Josh Triplett --- ident-list.h | 1 + simplify.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ident-list.h b/ident-list.h index e93aae7..5f1da5e 100644 --- a/ident-list.h +++ b/ident-list.h @@ -91,6 +91,7 @@ IDENT(artificial); IDENT(__artificial__); IDENT(leaf); IDENT(__leaf__); IDENT(vector_size); IDENT(__vector_size__); IDENT(error); IDENT(__error__); +IDENT(cleanup); IDENT(__cleanup__); /* Preprocessor idents. Direct use of __IDENT avoids mentioning the keyword diff --git a/simplify.c b/simplify.c index bda4a5b..2c266f9 100644 --- a/simplify.c +++ b/simplify.c @@ -619,7 +619,7 @@ offset: if (new == VOID) return 0; new = VOID; - warning(insn->pos, "crazy programmer"); + sparse_error(insn->pos, "internal error: failed to simplify a memory operation"); } insn->offset += off->value; use_pseudo(insn, new, &insn->src);