From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 11 13:06:44 2012 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 069DA3C6 for ; Thu, 11 Oct 2012 13:06:44 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id B7DFB8FC18 for ; Thu, 11 Oct 2012 13:06:43 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp3.one.com (Postfix) with ESMTPA id 66F052404978 for ; Thu, 11 Oct 2012 13:06:42 +0000 (UTC) From: Erik Cederstrand Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: curcpu false positive? Message-Id: <3A22DF7A-00BB-408C-8F76-C1E119E0E48C@cederstrand.dk> Date: Thu, 11 Oct 2012 15:06:41 +0200 To: FreeBSD Hackers Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) X-Mailer: Apple Mail (2.1486) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 13:06:44 -0000 Hello, I'm looking at some Clang Static Analyzer reports in the kernel, and a = lot of them point back to a null pointer dereference in __pcpu_type = (sys/amd64/include/pcpu.h:102) which is defined as: 102 /* 103 * Evaluates to the type of the per-cpu variable name. 104 */ 105 #define __pcpu_type(name) = \ 106 __typeof(((struct pcpu *)0)->name) Which indeed looks like a NULL pointer dereference. Looking at the = latest commit message there, I'm sure the code is correct, but I'm = unsure why the null pointer is OK. I'd appreciate an explanation :-) Thanks, Erik=