Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 26928 invoked from network); 18 Jun 2007 06:50:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 06:50:53 -0000 Received: (qmail 30917 invoked by uid 500); 18 Jun 2007 06:50:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 30904 invoked by uid 500); 18 Jun 2007 06:50:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 30892 invoked by uid 99); 18 Jun 2007 06:50:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Jun 2007 23:50:53 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Jun 2007 23:50:47 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 529D67141EB for ; Sun, 17 Jun 2007 23:50:27 -0700 (PDT) Message-ID: <11694847.1182149427335.JavaMail.jira@brutus> Date: Sun, 17 Jun 2007 23:50:27 -0700 (PDT) From: "Pavel Rebriy (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-4024) [drlvm][thread] VM crashes when a lot of threads invoke setUncaughtExceptionHandler or setDefaultUncaughtExceptionHandler methods In-Reply-To: <29333679.1180699701525.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505703 ] Pavel Rebriy commented on HARMONY-4024: --------------------------------------- There is no common parts with HARMONY-2742. The issue fixes thread_id reuse, HARMONY-2742 fixes fat monitors reuse. There is no reason to compare the JIRAs. Regarding fix way - yes, it's common for monitors and thread_ids. It's nothing at all serious. Regarding memory leak it need to make more investigation on it. > [drlvm][thread] VM crashes when a lot of threads invoke setUncaughtExceptionHandler or setDefaultUncaughtExceptionHandler methods > ---------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-4024 > URL: https://issues.apache.org/jira/browse/HARMONY-4024 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Windows > Reporter: Vera Petrashkova > Assignee: weldon washburn > Priority: Minor > Attachments: 0001-Fix-of-Thread-ID-bug.patch > > > The following test demonstrates that VM crashes when a lot of created threads use setUncaughtExceptionHandler > or setDefaultUncaughtExceptionHandler methods > --------------a1.java------------------- > public class a1 extends Thread { > public static int N_TH = 20; > public static void main (String[] argv) { > boolean def = true; > if (argv.length > 0) { > def = "true".equals(argv[0]); > } > try { > if (argv.length > 1) { > N_TH=Integer.parseInt(argv[1]); > } > } catch (Throwable e) { > } > a1_UncoughtExcHnd h = new a1_UncoughtExcHnd(); > for (int i = 0; i < 100000; i++) { > test(def, h); > if (i % 1000 == 0) { > System.err.println("Step: " + i + " finished"); > } > } > System.out.println("Test passed"); > } > public static void test(boolean defUncaught, a1_UncoughtExcHnd hnd) { > a1 t[] = new a1[N_TH]; > for (int i = 0; i < N_TH; i++) { > t[i]=new a1(); > if (defUncaught) { > t[i].setDefaultUncaughtExceptionHandler(hnd); > } else { > t[i].setUncaughtExceptionHandler(hnd); > } > t[i].start(); > } > try { > for (int i = 0; i < N_TH; i++) { > t[i].join(); > } > } catch (Throwable e) { > System.err.println(e); > } > } > public void m(int t) { > int t1 = 100/t; > } > public void run() { > m(0); > } > } > class a1_UncoughtExcHnd implements Thread.UncaughtExceptionHandler { > public static int count = 0; > public void uncaughtException(Thread t, Throwable e) { > count++; > throw new RuntimeException(e); > } > } > -------------------------------- > Run test with DefaultUncaughtExceptionHandler > java -cp . a1 true 20 > and with UncaughtExceptionHandler > java -cp . a1 false 20 > This test passes on RI in both cases: > Output: > ======= > On RI this test passes: > 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) > Step: 0 finished > ... > Step: 94000 finished > Step: 95000 finished > Step: 96000 finished > Step: 97000 finished > Step: 98000 finished > Step: 99000 finished > Test passed > DRLVM crashes on this test in both cases. > Output: > ====== > 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 = r542118, (May 28 2007), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > Step: 0 finished > The GC did not provide gc_add_weak_root_set_entry() > Step: 1000 finished > Windows reported exception: 0xc0000005 > Registers: > EAX: 0x00000000, EBX: 0x41c14bf8, ECX: 0x0e810048, EDX: 0x003927a4 > ESI: 0x00000000, EDI: 0x0babfe80, ESP: 0x0babfda0, EBP: 0x0babfddc > EIP: 0x10002a1e > Stack trace: > 0: hythread_monitor_notify_all (??:-1) > 1: java/lang/VMThreadManager.notifyAll(Ljava/lang/Object;)I (VMThreadManager.java:-2) > 2: java/lang/Object.notifyAll()V (Object.java:65) > 3: java/lang/Thread.runImpl()V (Thread.java:667) > > DRLVM crashes even if only 1 thread is created on the each step. > java -cp . a1 true 1 > Output > =========== > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r542118, (May 28 2007), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > Step: 0 finished > The GC did not provide gc_add_weak_root_set_entry() > Step: 1000 finished > Step: 2000 finished > Step: 3000 finished > .... > Step: 29000 finished > Step: 30000 finished > Step: 31000 finished > Step: 32000 finished > Step: 33000 finished > Windows reported exception: 0xc0000005 > Registers: > EAX: 0x00000000, EBX: 0x41c17188, ECX: 0x0e810048, EDX: 0x003927a4 > ESI: 0x00000000, EDI: 0x041ffe80, ESP: 0x041ffda0, EBP: 0x041ffddc > EIP: 0x10002a1e > Stack trace: > 0: hythread_monitor_notify_all (??:-1) > 1: java/lang/VMThreadManager.notifyAll(Ljava/lang/Object;)I (VMThreadManager.java:-2) > 2: java/lang/Object.notifyAll()V (Object.java:65) > 3: java/lang/Thread.runImpl()V (Thread.java:667) > > This bug causes the failure of the reliability test > api.kernel.thread.ExcptHandlerTest.ExcptHandlerTest > from http://issues.apache.org/jira/browse/HARMONY-2918 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.