WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Java Problems

To: Reuben Kabel <kabel@xxxxxxxxxx>
Subject: Re: [Xen-devel] Java Problems
From: Peter <peter@xxxxxxxxxxxxxxx>
Date: Sat, 13 Aug 2005 08:17:59 +1200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 13 Aug 2005 10:46:52 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <OF8DAF4393.0622A224-ON8525705B.004B18C0-8525705B.004B6D78@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <OF8DAF4393.0622A224-ON8525705B.004B18C0-8525705B.004B6D78@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513)
Hi.

I don't have a 2.0.7 to test on at the moment.  I will try again when I do.

I got rid of the object allocation inside the loop. And I retested. I don't hit the problem with int's on the call stack. I do hit the problem with floats and doubles.

The problem is quite easily reproducible (for me). Is someone there with knowledge of register/stack handle able to take a look with gdb or which ever tool you use?

Regards, Peter
http://rimuhosting.com - Xen VPS Hosting


public class FillTest {
    public static void main(String[] args) {
        System.out.println("Starting");
        foo f = new foo();
        for (int i = 0;i<100000000; i++) {
            f.iter = i;
            f.test();
        }
    }
    public static class foo {
        int iter;
        float f = 0.75f;
        int i=1;
        double d = 0.75d;
        void test() {
            testI(i);
            testD(d);
            test(f);
        }
        void test(float f1) {
            if(f1!=f) {
throw new RuntimeException("float value mismatch: " + f1 + " vs " + f + " at iteration " + iter);
            }
        }
        void testI(int fi) {
            if(fi!=i) {
throw new RuntimeException("int value mismatch: " + fi + " vs " + i + " at iteration " + iter);
            }
        }
        void testD(double fd) {
            if(fd!=d) {
throw new RuntimeException("double value mismatch: " + fd + " vs " + d + " at iteration " + iter);
            }
        }
    }
}


Starting
Exception in thread "main" java.lang.RuntimeException: double value mismatch: 0. 75 vs 0.75 at iteration 3981054
        at FillTest$foo.testD(FillTest.java:33)
        at FillTest$foo.test(FillTest.java:18)
        at FillTest.main(FillTest.java:8)
Starting
Starting
Exception in thread "main" java.lang.RuntimeException: double value mismatch: Na N vs 0.75 at iteration 33238270
        at FillTest$foo.testD(FillTest.java:33)
        at FillTest$foo.test(FillTest.java:18)
        at FillTest.main(FillTest.java:8)
Starting
Exception in thread "main" java.lang.RuntimeException: double value mismatch: 0.75 vs 0.75 at iteration 43731162
        at FillTest$foo.testD(FillTest.java:33)
        at FillTest$foo.test(FillTest.java:18)
        at FillTest.main(FillTest.java:8)
Starting
Exception in thread "main" java.lang.RuntimeException: double value mismatch: 0.75 vs 0.75 at iteration 26104068
        at FillTest$foo.testD(FillTest.java:33)
        at FillTest$foo.test(FillTest.java:18)
        at FillTest.main(FillTest.java:8)
Starting
Exception in thread "main" java.lang.RuntimeException: double value mismatch: 0.75 vs 0.75 at iteration 350370
        at FillTest$foo.testD(FillTest.java:33)
        at FillTest$foo.test(FillTest.java:18)
        at FillTest.main(FillTest.java:8)
Starting


Reuben Kabel wrote:



Does the following code exhibit the same problem? I've modified it so it
doesn't try to allocate many foo instances within the loop.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel