Skip to contentSkip to conversation

FPU incorrect on Mac OS X

Qemu-devel Michael Roitzsch 4 participants 10 messages Nov 9, 2010 – Sep 13, 2016

lore
Share & tools
lore
#0 lore raw

Public bug reported:

I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.

** Affects: qemu
Importance: Undecided
Status: New

Signature · 13 lines
FPU incorrect on Mac OS X
https://bugs.launchpad.net/bugs/672934
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.
#1 lore raw

** Patch added: "material to reproduce and patch"
https://bugs.launchpad.net/bugs/672934/+attachment/1727680/+files/QEMU-FPU-Mac.zip

Signature · 13 lines
FPU incorrect on Mac OS X
https://bugs.launchpad.net/bugs/672934
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.
#2 lore raw
In reply to Michael Roitzsch

** Attachment added: "bootable ISO to reproduce"
https://bugs.launchpad.net/qemu/+bug/672934/+attachment/1727686/+files/boot.iso

Signature · 13 lines
FPU incorrect on Mac OS X
https://bugs.launchpad.net/bugs/672934
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.
#3 lore raw
In reply to Michael Roitzsch

** Attachment added: "screenshot showing correct behavior"
https://bugs.launchpad.net/qemu/+bug/672934/+attachment/1727685/+files/after.png

Signature · 13 lines
FPU incorrect on Mac OS X
https://bugs.launchpad.net/bugs/672934
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.
#4 lore raw
In reply to Michael Roitzsch

** Patch removed: "material to reproduce and patch"
https://bugs.launchpad.net/qemu/+bug/672934/+attachment/1727680/+files/QEMU-FPU-Mac.zip

** Attachment added: "screenshot showing wrong behavior"
https://bugs.launchpad.net/qemu/+bug/672934/+attachment/1727684/+files/before.png

Signature · 13 lines
FPU incorrect on Mac OS X
https://bugs.launchpad.net/bugs/672934
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.
#5 lore raw
In reply to Michael Roitzsch

** Patch added: "patch which fixes problem on the Mac"
https://bugs.launchpad.net/qemu/+bug/672934/+attachment/1727687/+files/fpu-mac.patch

Signature · 13 lines
FPU incorrect on Mac OS X
https://bugs.launchpad.net/bugs/672934
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I work for a university and the affected guest OS is our own research OS. I believe I found a bug in QEMU's FPU emulation, which only triggers on the Mac. You can reproduce the problem by booting the attached ISO image.

Investigating the problem, I found that the lua interpreter in our loader component (called "ned") internally uses doubles to represent all lua-numbers. These doubles are showing completely wrong values on QEMU/Mac, resulting in the lua code not processing properly.

I also attached a patch which fixes the problem for me. The attached ZIP-file also contains "before" and "after" screenshots. Note that booting the ISO on a real machine or on a Linux-QEMU always shows the correct "after" behavior. Only QEMU on the Mac exhibits the wrong "before" behavior without my patch. The patch might break other systems setting the CONFIG_BSD flag, so maybe the preprocessor should check for __APPLE__ instead to make the fix Mac-only.
#6 lore raw
In reply to Michael Roitzsch

** Tags added: mac

Signature · 32 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/672934

Title:
  FPU incorrect on Mac OS X

Status in QEMU:
  New

Bug description:
  I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I
  work for a university and the affected guest OS is our own research
  OS. I believe I found a bug in QEMU's FPU emulation, which only
  triggers on the Mac. You can reproduce the problem by booting the
  attached ISO image.

  Investigating the problem, I found that the lua interpreter in our
  loader component (called "ned") internally uses doubles to represent
  all lua-numbers. These doubles are showing completely wrong values on
  QEMU/Mac, resulting in the lua code not processing properly.

  I also attached a patch which fixes the problem for me. The attached
  ZIP-file also contains "before" and "after" screenshots. Note that
  booting the ISO on a real machine or on a Linux-QEMU always shows the
  correct "after" behavior. Only QEMU on the Mac exhibits the wrong
  "before" behavior without my patch. The patch might break other
  systems setting the CONFIG_BSD flag, so maybe the preprocessor should
  check for __APPLE__ instead to make the fix Mac-only.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/672934/+subscriptions
#7 lore raw
In reply to Michael Roitzsch

Looks like the ISO from comment #4 (thanks for attaching that one!) shows the correct behavior with up to date QEMU 2.7. Also, the affected softfloat code has been completely reworked in between (e.g. with commit cf67c6bad56d43e6d60), so I assume this has been fixed sometimes in the past years.

** Changed in: qemu
Status: New => Fix Released

Signature · 32 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/672934

Title:
  FPU incorrect on Mac OS X

Status in QEMU:
  Fix Released

Bug description:
  I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I
  work for a university and the affected guest OS is our own research
  OS. I believe I found a bug in QEMU's FPU emulation, which only
  triggers on the Mac. You can reproduce the problem by booting the
  attached ISO image.

  Investigating the problem, I found that the lua interpreter in our
  loader component (called "ned") internally uses doubles to represent
  all lua-numbers. These doubles are showing completely wrong values on
  QEMU/Mac, resulting in the lua code not processing properly.

  I also attached a patch which fixes the problem for me. The attached
  ZIP-file also contains "before" and "after" screenshots. Note that
  booting the ISO on a real machine or on a Linux-QEMU always shows the
  correct "after" behavior. Only QEMU on the Mac exhibits the wrong
  "before" behavior without my patch. The patch might break other
  systems setting the CONFIG_BSD flag, so maybe the preprocessor should
  check for __APPLE__ instead to make the fix Mac-only.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/672934/+subscriptions
#8 lore raw
In reply to Michael Roitzsch

I can confirm that recent QEMU works fine. Sorry, I forgot about this bug and did not update it.

Signature · 32 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/672934

Title:
  FPU incorrect on Mac OS X

Status in QEMU:
  Fix Released

Bug description:
  I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I
  work for a university and the affected guest OS is our own research
  OS. I believe I found a bug in QEMU's FPU emulation, which only
  triggers on the Mac. You can reproduce the problem by booting the
  attached ISO image.

  Investigating the problem, I found that the lua interpreter in our
  loader component (called "ned") internally uses doubles to represent
  all lua-numbers. These doubles are showing completely wrong values on
  QEMU/Mac, resulting in the lua code not processing properly.

  I also attached a patch which fixes the problem for me. The attached
  ZIP-file also contains "before" and "after" screenshots. Note that
  booting the ISO on a real machine or on a Linux-QEMU always shows the
  correct "after" behavior. Only QEMU on the Mac exhibits the wrong
  "before" behavior without my patch. The patch might break other
  systems setting the CONFIG_BSD flag, so maybe the preprocessor should
  check for __APPLE__ instead to make the fix Mac-only.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/672934/+subscriptions
#9 lore raw
In reply to Michael Roitzsch

The patch is linked in my comment #5 above. However, the issue discussed here does not affect PPC, neither as the guest or host platform, so I’m not sure the patch applies to your problem.

Signature · 32 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/672934

Title:
  FPU incorrect on Mac OS X

Status in QEMU:
  Fix Released

Bug description:
  I am using the 0.13.0 release version of QEMU on Mac OS X 10.6.4. I
  work for a university and the affected guest OS is our own research
  OS. I believe I found a bug in QEMU's FPU emulation, which only
  triggers on the Mac. You can reproduce the problem by booting the
  attached ISO image.

  Investigating the problem, I found that the lua interpreter in our
  loader component (called "ned") internally uses doubles to represent
  all lua-numbers. These doubles are showing completely wrong values on
  QEMU/Mac, resulting in the lua code not processing properly.

  I also attached a patch which fixes the problem for me. The attached
  ZIP-file also contains "before" and "after" screenshots. Note that
  booting the ISO on a real machine or on a Linux-QEMU always shows the
  correct "after" behavior. Only QEMU on the Mac exhibits the wrong
  "before" behavior without my patch. The patch might break other
  systems setting the CONFIG_BSD flag, so maybe the preprocessor should
  check for __APPLE__ instead to make the fix Mac-only.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/672934/+subscriptions