From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 11 14:53:59 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76DA71065675; Sun, 11 Jul 2010 14:53:59 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 394FA8FC1D; Sun, 11 Jul 2010 14:53:59 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:7d06:cebd:c126:bf09] (unknown [IPv6:2001:7b8:3a7:0:7d06:cebd:c126:bf09]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4E63A5C43; Sun, 11 Jul 2010 16:53:57 +0200 (CEST) Message-ID: <4C39DB09.6010808@andric.com> Date: Sun, 11 Jul 2010 16:54:01 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8pre) Gecko/20100710 Lanikai/3.1.1pre MIME-Version: 1.0 To: Gabor Kovesdan References: <4C39D92F.4050605@FreeBSD.org> In-Reply-To: <4C39D92F.4050605@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers Subject: Re: strange problem with int64_t variables X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jul 2010 14:53:59 -0000 On 2010-07-11 16:46, Gabor Kovesdan wrote: > I have two int64_t variables in kernel code, first is stored internally > and the second one is passed from a syscall argument. When I print them > with printf %lld modifier, the internal one behaves correctly but the > other one I pass from a syscall has a corrupted value. If I pass 1, it > prints out 3735348794091372545. I'm not doing anything special with it > just reading it out from the struct that was generated with make sysent. Since 3735348794091372545 is 0x33d69ff000000001, it looks like the upper word got corrupted somehow. Maybe some part of it got non-atomically assigned? Maybe the wrong word was read? It is hard to tell without code... :)