harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vera Petrashkova (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4158) [drlvm][thead] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation
Date Thu, 14 Jun 2007 09:14:27 GMT
[drlvm][thead] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation
-------------------------------------------------------------------------------------------------

                 Key: HARMONY-4158
                 URL: https://issues.apache.org/jira/browse/HARMONY-4158
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Windows
            Reporter: Vera Petrashkova
            Priority: Minor


The following test demonstrates that VM throws unexpected java.lang.InternalError error 70025
on Thread.suspend() method invocation
Sometimes VM hangs after this error.
-----------------ThrSuspTest.java----------------------
public class ThrSuspTest {
    public static void main(String[] args) {
        ThrRunner tt = new ThrRunner();
        tt.start();
        try {
            Thread.sleep(20000);
            tt.interrupt();
        } catch (Throwable e) {
             e.printStackTrace();
        }
        System.err.println("+++++++ThrSuspTest: finished");
    }
}

class ThrRunner extends Thread {
     public void run() {
        th1_1 tt = new th1_1();
        tt.setDaemon(true);
        tt.start();
        th2_1 tt2 = new th2_1();
        tt2.setDaemon(true);
        tt2.start();
        th3_1 tt3 = new th3_1();
        tt3.setDaemon(true);
        tt3.start();

        try {
            Thread.sleep(10000);
            System.err.println("After sleep");
            tt.interrupt();
        } catch(InterruptedException e) {

        } catch (Throwable e) {
             e.printStackTrace();
        }
        System.err.println("=======ThrRunner finished");
        
    }
}
class th1_1 extends Thread {

    public void run() {
        System.err.println("Start th1_1");
        th1_2 aa = null;
        while (true) {
            try {
                aa = new th1_2();
                aa.start();
                aa.suspend();
                aa.resume();
                aa.interrupt();
            } catch (OutOfMemoryError er) {
            } catch (Throwable thr) {
                  thr.printStackTrace();
                return;
            }
        }
    }
}

class th1_2 extends Thread {
    static int i = 0;
    public void run() {
        try {
            while (true) {

                if (Thread.interrupted())
                    break;
                this.i = 1;
            }
        } catch (Throwable thr) {
            System.err.println("Unexpected:"+ thr);
        }
    }
}


class th2_1 extends Thread {
    public void run() {
System.err.println("Start th2_1");
        while (true) {
            try {
                new Thread().start();
                Thread.yield();
            } catch (OutOfMemoryError er) {
            } catch (Throwable thr) {
                System.err.println("Unexpected error in th2_1: "+thr);
                return;
            }
        }
    }
}


class th3_1 extends Thread {
    int objectSize;

    public th3_1(int objectSize) {
        this.objectSize = objectSize;
    }

    public th3_1() {
        this.objectSize = 1000;
    }

    public void run() {
System.err.println("Start th3_1");
        while (true) {
            try {
                new th3_2(objectSize);
            } catch (OutOfMemoryError er) {
            } catch (Throwable thr) {
                System.err.println("Unexpected error in th3_1: "+thr);
                return;            }
        }
    }
}

class th3_2 {
    int testArray[];

    public th3_2(int arraySize) {
        int testArray[] = new int[arraySize];
        this.testArray = testArray;
    }
}
--------------------------------

RI never throws InternalError on this test and it finishes corectly
Output on RI:
============
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

Start th1_1
Start th2_1
Start th3_1
After sleep
=======ThrRunner finished
+++++++ThrSuspTest: finished


Output on DRLVM:
=================
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its l
icensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r546878, (Jun 13 2007), Windows/ia32/msvc 1310, release build
http://harmony.apache.org
Start th1_1
Start th3_1
Start th2_1
The GC did not provide gc_add_weak_root_set_entry()
java.lang.InternalError: Thread Manager internal error 70025
        at java.lang.Thread.suspend(Thread.java:871)
        at th1_1.run(ThrSuspTest.java:49)
After sleep
=======ThrRunner finished
+++++++ThrSuspTest: finished

This issue causes the intermittent failures of the stress.org.apache.harmony.test.stress.misc.stressloads
tests from
Stress test suite (http://issues.apache.org/jira/browse/HARMONY-3536)
which use class as th1_1 from attached test.
For example,
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest01.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest04.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest06.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest10.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest15.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest16.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest17.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest20.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest21.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest22.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest23.xml
stress/org/apache/harmony/test/stress/misc/stressloads/tests/StressLoadsRunnerTest24.xml


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message