Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6V85-0001kf-1z for qemu-devel@nongnu.org; Mon, 15 Jan 2007 11:56:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6V84-0001jz-3s for qemu-devel@nongnu.org; Mon, 15 Jan 2007 11:56:16 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6V83-0001jq-RA for qemu-devel@nongnu.org; Mon, 15 Jan 2007 11:56:15 -0500 Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H6V83-0001uR-D5 for qemu-devel@nongnu.org; Mon, 15 Jan 2007 11:56:15 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H6OA1-0004nF-Vn for qemu-devel@nongnu.org; Mon, 15 Jan 2007 10:29:49 +0100 Received: from fbxmetz.linbox.com ([81.56.128.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jan 2007 10:29:49 +0100 Received: from ldrolez by fbxmetz.linbox.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jan 2007 10:29:49 +0100 From: Ludovic Drolez Date: Mon, 15 Jan 2007 09:29:42 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: news Subject: [Qemu-devel] QEMU x86_64: sles 64, bug in modf() Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi ! I've found a bug in Qemu x86_64 under a sles 64 10: conversion of floats to strings fails in some cases. For example, Ganglia (cluster monitoring software), shows random values and as well as PHP5 programs. I've trace a conversion and it seems that the modf() function is buggy under QEMU. The same code run a real system is OK. ========= #include #include int main() { double x = 1.1; double y; double z; printf("Calling modf() for %f\n", x); z = modf(x,&y); printf("fractional part = %f\ninteger part = %f\n", z, y); return 0; } ========= Under QEMU you get: Calling modf() for 1.100000 fractional part = 1.100000 integer part = 1.000000 And on a real system: Calling modf() for 1.100000 fractional part = 0.100000 integer part = 1.000000 So it's a QEMU bug, maybe cause by bogus instructions generated by the SLES gcc compiler (gcc 4.1.0 !). If anyone has an idea on how to fix this, let me know. Cheers, Ludovic.