Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 86538 invoked from network); 22 Jun 2007 21:59:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jun 2007 21:59:50 -0000 Received: (qmail 85138 invoked by uid 500); 22 Jun 2007 21:59:51 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 85113 invoked by uid 500); 22 Jun 2007 21:59:51 -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 84983 invoked by uid 99); 22 Jun 2007 21:59:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jun 2007 14:59:51 -0700 X-ASF-Spam-Status: No, hits=-99.4 required=10.0 tests=ALL_TRUSTED,FUZZY_VLIUM 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; Fri, 22 Jun 2007 14:59:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 82F057141F0 for ; Fri, 22 Jun 2007 14:59:26 -0700 (PDT) Message-ID: <12336971.1182549566533.JavaMail.jira@brutus> Date: Fri, 22 Jun 2007 14:59:26 -0700 (PDT) From: "Rana Dasgupta (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-3627) [drlvm][exception] VM works incorrectly if several threads catch StackOverflowError In-Reply-To: <9447503.1176352412430.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-3627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507528 ] Rana Dasgupta commented on HARMONY-3627: ---------------------------------------- It seems to me that when this test is run with many threads and multiple times, sometimes ( even during clean exit ) the stack guard state does not get get restored correctly. So the stack area is left unguarded and next time the stack overflows into the unmapped area at the bottom of the stack. I don't think that think that this type of access violation is catchable because NT treats it as a fatal error and tears down the process. We can test this out by putting a debug BP or some trace messages in asm_exception_catch_callback to ensure that the guard is getting reset. I don't have time to try this out right now, sorry. > [drlvm][exception] VM works incorrectly if several threads catch StackOverflowError > ----------------------------------------------------------------------------------- > > Key: HARMONY-3627 > URL: https://issues.apache.org/jira/browse/HARMONY-3627 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Vera Petrashkova > Priority: Minor > > When several threads expect StackOverflowError then VM works incorrectly. > The following test demonstrates this issue. > VM crashes or finish its run abnormally. > ----------------test.java------------------- > public class test extends Thread { > public static void main (String[] argv) { > int N_TH = 5; > try { > if (argv.length > 0) { > N_TH=Integer.parseInt(argv[0]); > } > } catch (Throwable e) { > } > test t[] = new test[N_TH]; > for (int i = 0; i < N_TH; i++) { > t[i]=new test(); > t[i].start(); > } > try { > for (int i = 0; i < N_TH; i++) { > t[i].join(); > } > } catch (Throwable e) { > System.err.println(e); > } > System.out.println("Test passed"); > } > public void m(int t) { > m(t+1); > } > public void run() { > System.err.println("Start"); > try { > m(0); > } catch (StackOverflowError e) { > } > } > } > ------------------------------ > Run test > java -cp . test 20 > Output: > Sometimes test passes. > 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 = r526746, (Apr 10 2007), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > Start > ... > Start > Test passed > But usually VM does not report full message and finishes execution or crashes: > Start > Start > Start -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.