qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] QEMU x86_64: sles 64, bug in modf()


From: Ludovic Drolez
Subject: [Qemu-devel] QEMU x86_64: sles 64, bug in modf()
Date: Mon, 15 Jan 2007 09:29:42 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.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 <stdio.h>
#include <math.h>

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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]