You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vera Petrashkova (JIRA)" <ji...@apache.org> on 2007/06/14 11:14:27 UTC

[jira] Created: (HARMONY-4158) [drlvm][thead] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

[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.


[jira] Commented: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "Peter Novodvorsky (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506729 ] 

Peter Novodvorsky commented on HARMONY-4158:
--------------------------------------------

I've done evaluation of this bug and I've found the following:

original bug can be fixed pretty easily:

Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java
===================================================================
--- vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java  (revision 549080
)
+++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java  (working copy)
@@ -865,12 +865,17 @@
      * @deprecated
      */
     public final void suspend() {
-            checkAccess();
-            int status = VMThreadManager.suspend(this);
-            if (status != VMThreadManager.TM_ERROR_NONE) {
-                throw new InternalError(
-                    "Thread Manager internal error " + status);
-            }
+       int status;
+
+       checkAccess();
+       do {
+           status = VMThreadManager.suspend(this);
+       } while (status == VMThreadManager.TM_ERROR_EBUSY);
+
+       if (status != VMThreadManager.TM_ERROR_NONE) {
+           throw new InternalError(
+                                   "Thread Manager internal error " + status);
+       }
     }
 
     /**
Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/VMThreadManager.java
===================================================================
--- vm/vmcore/src/kernel_classes/javasrc/java/lang/VMThreadManager.java (revisio
n 549080)
+++ vm/vmcore/src/kernel_classes/javasrc/java/lang/VMThreadManager.java (working
 copy)
@@ -43,8 +43,8 @@
     public static final int TM_ERROR_NONE = 0;
     public static final int TM_ERROR_INTERRUPT = 52;
     public static final int TM_ERROR_ILLEGAL_STATE = 51;
+    public static final int TM_ERROR_EBUSY = 70025;
 
-
     /**
      * JVMTI constants
      */

The reason of hanging of modified test is typical shutdown bug. During shutdown we first cancel daemon thread holding some important monitor and then while running java_thread_detach on the main thread we hang on this lock. This may be solved by intruducing special detach function for main thread that will try to pass all the monitors without really entering them.

Another bug I've found is that in VERY rare cases the whole thing segfaults in shutdown running  GC.  Perhaps, it's a GC bug, bug it can be caught very rarely.

The backtrace is following:

(gdb) where
#0  0x405f41f7 in memset () from /lib/tls/libc.so.6
#1  0x00000000 in ?? ()
#2  0x4278e2bf in hashcode_buf_create () at hashcode.h:85
#3  0x4279d32d in mspace_move_objects (collector=0x80bec50, mspace=0x80b8df8)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/mark_compact/mspace_move_compact.cpp:45
#4  0x4279d7a0 in move_compact_mspace (collector=0x80bec50)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/mark_compact/mspace_move_compact.cpp:199
#5  0x42787c66 in collector_thread_func (arg=0x80bec50)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/thread/collector.cpp:181
#6  0x4003f7cb in thread_start_proc (arg=0x80bef48)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:714
#7  0x40798a13 in start_thread () from /lib/tls/libpthread.so.0
#8  0x406439da in clone () from /lib/tls/libc.so.6

other threads are
#0  0xffffe410 in ?? ()
#1  0xbfffcfc8 in ?? ()
#2  0x00000000 in ?? ()
#3  0x4140f3b4 in __JCR_LIST__ ()
   from /localdisk/users/panovodv/harmony/tree/trunk/working_vm/build/lnx_ia32_gcc_debug/deploy/jdk/jre/bin/default/libharmonyvm.so
#4  0x4062e07c in sched_yield () from /lib/tls/libc.so.6
#5  0x4003ef66 in hythread_yield ()
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:329
#6  0x4120ce5c in wait_native_ref_thread_detached ()
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/init/ref_enqueue_thread.cpp:92
#7  0x4122c8f5 in vm_destroy (java_vm=0x807fa58, java_thread=0x850b8e0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/init/vm_shutdown.cpp:193
#8  0x411980f9 in DestroyJavaVM (vm=0x807fa58)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/jni/jni.cpp:1473
#9  0x08049c75 in invocation (portLibrary=0xbfffd250, argc=2, argv=0xbfffd694, 
    handle=134668384, version=65540, ignoreUnrecognized=1 '\001', 
    mainClass=0xbffff1b3 "ThrSuspTest", classArg=1, 
    propertiesFileName=0x806df58 "/localdisk/users/panovodv/harmony/tree/trunk/w

#4  0x4079a896 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#5  0x4064f1b3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6
#6  0x4003d6d2 in os_cond_timedwait (cond=0x80bed60, mutex=0x80bed90, ms=0, 
    nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/linux/os_condvar.c:42
#7  0x4003f9dd in condvar_wait_impl (cond=0x80bed60, mutex=0x80bed90, ms=0, 
    nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_condvar.c:55
#8  0x40041391 in sem_wait_impl (sem=0x80bed58, ms=0, nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:70
#9  0x40041464 in hysem_wait (sem=0x80bed58)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:107
#10 0x4278804e in vm_wait_event (event=0x80bed58) at gc_platform.h:68
#11 0x42787a2d in wait_collector_to_finish (collector=0x80bec50)

#4  0x4079a896 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#5  0x4064f1b3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6
#6  0x4003d6d2 in os_cond_timedwait (cond=0x883be60, mutex=0x883be90, ms=0, 
    nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/linux/os_condvar.c:42
#7  0x4003f9dd in condvar_wait_impl (cond=0x883be60, mutex=0x883be90, ms=0, 
    nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_condvar.c:55
#8  0x40041391 in sem_wait_impl (sem=0x883be58, ms=0, nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:70
#9  0x40041464 in hysem_wait (sem=0x883be58)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:107
#10 0x4004190d in thread_safe_point_impl (thread=0x883a6f8)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_suspend.c:137
#11 0x400422d0 in set_suspend_disable (count=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_suspend.c:458
#12 0x4003f9ee in condvar_wait_impl (cond=0x88625b8, mutex=0x88625a0, ms=0, 
    nano=0, interruptable=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_condvar.c:57
#13 0x4003ff6d in monitor_wait_impl (mon_ptr=0x88625a0, ms=0, nano=0, 
    interruptable=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_fat_monitor.c:189
#14 0x40043594 in thin_monitor_wait_impl (lockword_ptr=0x436a0280, ms=0, 
    nano=0, interruptable=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_thin_monitor.c:485
#15 0x40043612 in hythread_thin_monitor_wait_interruptable (
    lockword_ptr=0x436a0280, ms=0, nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_thin_monitor.c:537
#16 0x4131b2c0 in jthread_monitor_timed_wait (monitor=0x58cfc3dc, millis=0, 
    nanos=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_java_monitors.c:337
#17 0x4117b668 in Java_java_lang_VMThreadManager_wait (env=0x8841e28, 
    clazz=0x58cfc3d8, monitor=0x58cfc3dc, millis=0, nanos=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/kernel_classes/native/java_lang_VMThreadManager.cpp:201

#4  0x4079a896 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#5  0x4064f1b3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6
#6  0x4003d6d2 in os_cond_timedwait (cond=0x8862098, mutex=0x8862080, ms=0, 
    nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/linux/os_condvar.c:42
#7  0x4003f9dd in condvar_wait_impl (cond=0x8862098, mutex=0x8862080, ms=0, 
    nano=0, interruptable=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_condvar.c:55
#8  0x4003ff6d in monitor_wait_impl (mon_ptr=0x8862080, ms=0, nano=0, 
    interruptable=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_fat_monitor.c:189
#9  0x40043594 in thin_monitor_wait_impl (lockword_ptr=0x437a8530, ms=0, 
    nano=0, interruptable=1)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_thin_monitor.c:485
---Type <return> to continue, or q <return> to quit---
#10 0x40043612 in hythread_thin_monitor_wait_interruptable (
    lockword_ptr=0x437a8530, ms=0, nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_thin_monitor.c:537
#11 0x4131b2c0 in jthread_monitor_timed_wait (monitor=0x584fb3dc, millis=0, 
    nanos=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_java_monitors.c:337
#12 0x4117b668 in Java_java_lang_VMThreadManager_wait (env=0x8837660, 
    clazz=0x584fb3d8, monitor=0x584fb3dc, millis=0, nanos=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/kernel_classes/native/java_lang_VMThreadManager.cpp:201

#4  0x4079a896 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#5  0x4064f1b3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6
#6  0x4003d6d2 in os_cond_timedwait (cond=0x877c508, mutex=0x877c538, ms=0, 
    nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/linux/os_condvar.c:42
#7  0x4003f9dd in condvar_wait_impl (cond=0x877c508, mutex=0x877c538, ms=0, 
    nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_condvar.c:55
#8  0x40041391 in sem_wait_impl (sem=0x877c500, ms=0, nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:70
#9  0x40041464 in hysem_wait (sem=0x877c500)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:107
#10 0x4120cfdd in wait_pending_reference ()
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/init/ref_enqueue_thread.cpp:126
#11 0x4120d0b3 in ref_enqueue_thread_func (args=0x877c428)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/init/ref_enqueue_thread.cpp:149
#12 0x4003f7cb in thread_start_proc (arg=0x877ee58)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:714
#13 0x40798a13 in start_thread () from /lib/tls/libpthread.so.0
#14 0x406439da in clone () from /lib/tls/libc.so.6

#4  0x4079a896 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/libpthread.so.0
#5  0x4064f1b3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6
#6  0x4003d6d2 in os_cond_timedwait (cond=0x877ec70, mutex=0x877eca0, ms=0, 
    nano=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/linux/os_condvar.c:42
#7  0x4003f9dd in condvar_wait_impl (cond=0x877ec70, mutex=0x877eca0, ms=0, 
    nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_condvar.c:55
#8  0x40041391 in sem_wait_impl (sem=0x877ec68, ms=0, nano=0, interruptable=0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:70
#9  0x40041464 in hysem_wait (sem=0x877ec68)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_semaphore.c:107
#10 0x4117565f in wait_pending_finalizer ()
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/ini---Type <return> to continue, or q <return> to quit---
t/finalizer_thread.cpp:207
#11 0x41175761 in finalizer_thread_func (args=0x877ef90)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/vmcore/src/init/finalizer_thread.cpp:237
#12 0x4003f7cb in thread_start_proc (arg=0x877ee58)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:714

#0  0x4279b99b in obj_end (obj=0x42cd5248) at gc_block.h:122
#1  0x4279b964 in block_get_next_marked_object (block=0x42cd0000, 
    start_pos=0x541c59c4) at gc_block.h:207
#2  0x4279d4f2 in mspace_move_objects (collector=0x80bf310, mspace=0x80b8df8)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/mark_compact/mspace_move_compact.cpp:102
#3  0x4279d7a0 in move_compact_mspace (collector=0x80bf310)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/mark_compact/mspace_move_compact.cpp:199
#4  0x42787c66 in collector_thread_func (arg=0x80bf310)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/thread/collector.cpp:181
#5  0x4003f7cb in thread_start_proc (arg=0x80bf2a8)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:714

#0  0x4279b9c1 in obj_end (obj=0x42cce18c) at gc_block.h:124
#1  0x4279b964 in block_get_next_marked_object (block=0x42cc8000, 
    start_pos=0x539c49c4) at gc_block.h:207
#2  0x4279d4f2 in mspace_move_objects (collector=0x80befb0, mspace=0x80b8df8)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/mark_compact/mspace_move_compact.cpp:102
#3  0x4279d7a0 in move_compact_mspace (collector=0x80befb0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/mark_compact/mspace_move_compact.cpp:199
#4  0x42787c66 in collector_thread_func (arg=0x80befb0)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/gc_gen/src/thread/collector.cpp:181
#5  0x4003f7cb in thread_start_proc (arg=0x80bf2a8)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:714
#6  0x40798a13 in start_thread () from /lib/tls/libpthread.so.0
#7  0x406439da in clone () from /lib/tls/libc.so.6

#3  0x00000000 in ?? ()
#4  0x4079c764 in sem_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0
#5  0x4056f708 in __JCR_LIST__ ()
   from /localdisk/users/panovodv/harmony/tree/trunk/working_vm/build/lnx_ia32_gcc_debug/deploy/jdk/jre/bin/libhyprt.so
#6  0x40569019 in asynchSignalReporter (userData=0x0) at hysignal.c:477
#7  0x4003f7cb in thread_start_proc (arg=0x806dc00)
    at /localdisk/users/panovodv/harmony/tree/trunk/working_vm/vm/thread/src/thread_native_basic.c:714
#8  0x40798a13 in start_thread () from /lib/tls/libpthread.so.0
#9  0x406439da in clone () from /lib/tls/libc.so.6


> [drlvm][thread] 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
>            Assignee: weldon washburn
>            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.


[jira] Commented: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "weldon washburn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507085 ] 

weldon washburn commented on HARMONY-4158:
------------------------------------------

The patch (threadsuspend_2.diff) seems correct.  I have been unable to reproduce the problem reported.  My guess is that Vera's test uncovers some intermittant bugs.

One thing I worry about is the very remote possiblity that 2+ threads calling Thread.suspend simultaeously could somehow "livelock" and return continuously return TM_ERROR_EBUSY without ever making forward progress.  My guess is that we only have to worry about this if someone builds a stress test that shows such problem.  Note: I see very little value in such test.



> [drlvm][thread] 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
>            Assignee: weldon washburn
>            Priority: Minor
>         Attachments: threadsuspend.diff, threadsuspend_2.diff
>
>
> 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.


[jira] Assigned: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "weldon washburn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

weldon washburn reassigned HARMONY-4158:
----------------------------------------

    Assignee: weldon washburn

> [drlvm][thread] 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
>            Assignee: weldon washburn
>            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.


[jira] Commented: (HARMONY-4158) [drlvm][thead] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "Vera Petrashkova (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505044 ] 

Vera Petrashkova commented on HARMONY-4158:
-------------------------------------------

I tried to change this test: removed suspend()/resume() methods from this test or replaced them by 
invocation some method defined in th1_1 class.
----------------
class th1_1 extends Thread {

    public void doSome() {
        int [] t = new int[10000];
        int [] t1 = new int[10000];
        for (int i=0; i < t.length; i++) {
            t[i] = i;
        }
        for (int i=0; i < t.length; i++) {
            t1[10000 - i - 1] = t[i];
        }
}
    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();

//      doSome();
                aa.interrupt();
            } catch (OutOfMemoryError er) {
            } catch (Throwable thr) {
                  thr.printStackTrace();
                return;
            }
        }
    }
}
----------------
 
In this case VM usually hangs after reporting 
=======ThrRunner finished
+++++++ThrSuspTest: finished

But updated test finishes correctly on RI.

Thanks
Vera

> [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.


[jira] Closed: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "weldon washburn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

weldon washburn closed HARMONY-4158.
------------------------------------

    Resolution: Fixed

> [drlvm][thread] 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
>            Assignee: weldon washburn
>            Priority: Minor
>         Attachments: threadsuspend.diff, threadsuspend_2.diff
>
>
> 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.


[jira] Updated: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky updated HARMONY-4158:
---------------------------------------

    Summary: [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation  (was: [drlvm][thead] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation)

> [drlvm][thread] 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.


[jira] Commented: (HARMONY-4158) [drlvm][thead] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "weldon washburn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504694 ] 

weldon washburn commented on HARMONY-4158:
------------------------------------------

I notice that this test uses Thread.suspend() and Thread.resume().  Can the failure be reproduced without using these APIs?  The reason I ask is because suspend/resume are deprecated APIs.  We may want to prioritize bugs against non-deprecated APIs at a higher priority than suspend/resume bugs.

> [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.


[jira] Updated: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "Peter Novodvorsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Novodvorsky updated HARMONY-4158:
---------------------------------------

    Attachment: threadsuspend_2.diff

updated patch with a comment

> [drlvm][thread] 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
>            Assignee: weldon washburn
>            Priority: Minor
>         Attachments: threadsuspend.diff, threadsuspend_2.diff
>
>
> 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.


[jira] Updated: (HARMONY-4158) [drlvm][thread] VM sometimes throws unexpected InternalError on Thread.suspend() method invocation

Posted by "Peter Novodvorsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Novodvorsky updated HARMONY-4158:
---------------------------------------

    Attachment: threadsuspend.diff

This patch fixes Thread.suspend() problem. Recent patch from HARMONY-3864 should fix the problem with hanging in the end of execution (in shutdown stage).

Vera, please test.

> [drlvm][thread] 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
>            Assignee: weldon washburn
>            Priority: Minor
>         Attachments: threadsuspend.diff
>
>
> 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.