qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] QEMU x86_64: sles 64, bug with floats (with test program) (3rd try)
@ 2007-01-11 10:09 Ludovic Drolez
  2007-01-11 11:00 ` [Qemu-devel] " Loiseleur Michel
  0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Drolez @ 2007-01-11 10:09 UTC (permalink / raw)
  To: qemu-devel

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.

Here is a simple test program to confirm that you have the same bug as me
(maybe also under another distribution). Compile this and link with libapr-1:

======================test.c===============
#include <stdio.h>
#include <math.h>
#include <apr.h>
#include <apr_strings.h>

void main(void)
{
    char buf[60];
    double d = M_PI;

    snprintf(buf, 60, "%f\n", d);
    printf(buf);
    apr_snprintf(buf, 60, "%f\n", d);
    printf(buf);

}
============================================

Under a SLES 10/64 bits, you'll see something like:
3.141593
3.Ojuç_

I tested with Qemu 0.8.2 and the CVS, but of course, it works on a real
system (a Dell PE1950).

So it's a QEMU bug. Is it triggered by weird code produced by gcc 4.1.0 ? Or a
FPU emulation bug ? Any ideas ?

-- 
Ludovic DROLEZ                              Linbox / Free&ALter Soft
http://lrs.linbox.org 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: QEMU x86_64:   sles 64, bug with floats (with test program) (3rd try)
  2007-01-11 10:09 [Qemu-devel] QEMU x86_64: sles 64, bug with floats (with test program) (3rd try) Ludovic Drolez
@ 2007-01-11 11:00 ` Loiseleur Michel
  0 siblings, 0 replies; 2+ messages in thread
From: Loiseleur Michel @ 2007-01-11 11:00 UTC (permalink / raw)
  To: qemu-devel

Ludovic Drolez wrote:
> 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.
> 
> Here is a simple test program to confirm that you have the same bug as me
> (maybe also under another distribution). Compile this and link with libapr-1:
> 
> ======================test.c===============
> #include <stdio.h>
> #include <math.h>
> #include <apr.h>
> #include <apr_strings.h>
> 
> void main(void)
> {
>     char buf[60];
>     double d = M_PI;
> 
>     snprintf(buf, 60, "%f\n", d);
>     printf(buf);
>     apr_snprintf(buf, 60, "%f\n", d);
>     printf(buf);
> 
> }
> ============================================
> 
> Under a SLES 10/64 bits, you'll see something like:
> 3.141593
> 3.Ojuç_
> 
> I tested with Qemu 0.8.2 and the CVS, but of course, it works on a real
> system (a Dell PE1950).
> 
> So it's a QEMU bug. Is it triggered by weird code produced by gcc 4.1.0 ? Or a
> FPU emulation bug ? Any ideas ?
> 
A bug in apr, maybe, no ?


Rgds,
-- 
Michel Loiseleur

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-11 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-11 10:09 [Qemu-devel] QEMU x86_64: sles 64, bug with floats (with test program) (3rd try) Ludovic Drolez
2007-01-11 11:00 ` [Qemu-devel] " Loiseleur Michel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).