From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755660AbZFPOyW (ORCPT ); Tue, 16 Jun 2009 10:54:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751023AbZFPOyN (ORCPT ); Tue, 16 Jun 2009 10:54:13 -0400 Received: from mail-pz0-f187.google.com ([209.85.222.187]:55533 "EHLO mail-pz0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133AbZFPOyM convert rfc822-to-8bit (ORCPT ); Tue, 16 Jun 2009 10:54:12 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=AgsdvVli8dgK3XyGSbKMK7ELZkO7X+su/F27F59iZF4SGYdZS+KaQWSSsaRvx2pio8 0eleXspHbTlgAQxM1nVyM2ckSlUheQqG87r8sBvjEuPfFFMpkzq9ENSE8fnLEZPmMQgE CzTw4BkGE1YE79E7fJIsiDcOe/PJu7+O9FnOg= MIME-Version: 1.0 In-Reply-To: References: <87iqjedf2a.fsf@basil.nowhere.org> Date: Tue, 16 Jun 2009 16:54:15 +0200 Message-ID: Subject: Re: smatch 1.53 released From: Dan Carpenter To: Christian Kujau Cc: Andi Kleen , LKML Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/9/09, Christian Kujau wrote: > On Thu, 4 Jun 2009, Dan Carpenter wrote: >>> Smatch is a source code checker for C. Right now the focus is on >>> checking >>> for kernel bugs. > > Hm, smatch is pretty noisy. I'm getting hundreds of warnings and errors on > a randconfig build: http://nerdbynature.de/bits/smatch/ > > False positives or real issues? > If itīs not in drivers/ itīs a false positive. Otherwise there is a 95% chance it is a false positive. In an ideal world there would be no bugs and no false positives. But itīs easier to fix the bugs smatch reports than to fix smatch so probably eventually it will be 100% false positives. Quite a lot of the time, I donīt know the code well enough to say whether a bug is a false positive or not. Check the bits that you care about. The smatch output format is designed for vim. "vim filename.c +lineno" If there was some way to get rid of the "field" messages that would reduce the false positive count by 20. kernel/trace/trace_functions_graph.c +808 print_graph_function(14) error: dereferencing undefined: 'field' I donīt see a heuristic to do that. The rest are smatch bugs. Code like: foo->bar = NULL; foo = frob(); foo->bar->baz = x; // smatch thinks this is a bug since foo->bar was set to NULL. Sometimes running smatch with the --debug option can help to find where smatch gets it wrong. kchecker also takes the --debug option. regards, dan carpenter > Thanks, > Christian. > -- > BOFH excuse #182: > > endothermal recalibration >