harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Berezhniuk (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3627) [drlvm][exception] VM works incorrectly if several threads catch StackOverflowError
Date Mon, 25 Jun 2007 09:24:26 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507829
] 

Ilya Berezhniuk commented on HARMONY-3627:
------------------------------------------

I agree that ihat in general it's a design issue.
My two cents for (1):
I think in future we can ask major components for required stack size in vm initialization
(before vm_attach() call), and then use maximal value for setting guard page for all threads
including main thread. But switching to alternate stack is difficult on Windows - JIT should
support it itself.

But current issue is simply a bug - we doesn't rethrow pending thread  exception when return
from recompilation.
I stepped again through code after stack overflow in native - it was in memory allocation
for STL collection in EM, or in JIT compilation - but always in eb_profiler_sync_mode_callback().
VM does not crashes in native, it always successfully returns from native to Java and checks
for pending thread exception to rethrow it - but see no pending exception. So I'll try to
find a cause for such behavior, and will try to fix it.

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


Mime
View raw message