From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 25 23:41:26 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 024F1106566C; Thu, 25 Mar 2010 23:41:26 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BB74B8FC1F; Thu, 25 Mar 2010 23:41:24 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id BAA18402; Fri, 26 Mar 2010 01:41:22 +0200 (EET) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Nuwfx-0000oC-Uk; Fri, 26 Mar 2010 01:41:21 +0200 Message-ID: <4BABF4A1.6050205@icyb.net.ua> Date: Fri, 26 Mar 2010 01:41:21 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: freebsd-emulation@freebsd.org, vbox@freebsd.org, freebsd-hackers@freebsd.org X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: WARNING pid ... (VBoxSVC): ioctl sign-extension ioctl ffffffffc4a81502 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: Thu, 25 Mar 2010 23:41:26 -0000 On VirtualBox startup the following messages are produced in system log: WARNING pid ... (VBoxSVC): ioctl sign-extension ioctl ffffffffc4a81502 This happens on amd64 platform. I think the reason for this is in RTFileIoCtl() helper function (in VBox/Runtime/r3/posix/fileio-posix.cpp). This function takes iRequest argument as 'int' and then passes it as the second parameter to ioctl(2). But on FreeBSD that parameter, request, is expected to be of type unsigned long. Thus, a sufficiently large value of a request gets represented as a negative value in iRequest, which then leads to the warning. On the other hand, looking at how ioctl(2) is declared in other operating systems, I am not sure who is right and who is wrong here. Maybe we should a cast to unsigned int in RTFileIoCtl() for __FreeBSD__ case. Maybe FreeBSD should just suck it up and remove the noisy warning. I know too little to suggest a resolution. P.S. it seems that Mac OS X is in the same boat as FreeBSD, perhaps other BSDs too. -- Andriy Gapon