Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: double to string causes divide by zero!



Philip Crotwell <email@hidden> wrote:

>The error appears for me on both a 10.2.8 dual processor G5 and a
>single processor 10.3.2 G5, but it doesn't seems to happen on 10.3.2 on
>a G4. Very strange, could there be something different about the G5
>with threads in java?

The G5 has 64-bit general-purpose registers, while the G4 has 32-bits in
those registers.

Apple's JVM/JITC on a G5 will detect the G5 and emit 64-bit code for
certain integer operations.

If the 64-bit code has a subtle flaw of some kind, then the problem would
only appear on G5 machines, because they are the only ones running 64-bit
code.

I'm not sure how threads would make the problem appear, unless the problem
is that the full 64-bit-register context is not being saved and restored as
threads switch. That would be bad.

All the above is mere speculation at this point.

In my view, it is very unlikely that the problem is in StringBuffer
appending, per se. Far more likely is the conversion of a double to
numeric digits, since that's where divide and modulo occur, and the error
is a divide by zero. I don't think there's any division involved in
appending to a StringBuffer.

The exact code that causes the error is easily identified in your stack
traces. The class is always java.lang.FloatingDecimal, the method is
dtoa(), and the line# is 780 in 1.4.1_01-68, and 767 in the 1.4.2 release.
The source can be found in "src.jar" in the JavaVM.framework folder, after
the Java Developer Tools have been installed. It'd be worth a look to see
what operation is failing, even if it may not reveal how threads contribute.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.