harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Afremov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-945) Current implementation of DRL VM doesn't support Stack Overflow Error (SOE).
Date Fri, 21 Jul 2006 11:18:14 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-945?page=all ]

Pavel Afremov updated HARMONY-945:
----------------------------------

    Attachment: 0001-This-patch-adds-support-of-Stack-Overflow-Error-SOE-for-JIT-mode-into-VM.patch

This patch adds support of Stack Overflow Error (SOE) for DRL VM in JIT mode.

It's implementation for both Windows and Linux ia32 platforms based on protected
page on the stack.

There are two main schemes of SOE processing here:
1) If current frame is unwindable (usual java code) signal handler or vectored
exception handler throw usual java exception.
2) If current frame is nonunwindable (JNI native code for example) VM sets
exceptions for the current thread and continues its execution from interrupted.
place. A code which works in nonunwindable mode should periodically check that
no exception is raised.

This implementation discover some problems in current VM implementation
(including JIT):
1) Some parts of VM which use long recursion calls in nonunwindable mode (JIT
compiler, verifier) don't check that SOE is happened. I implemented check that
there are 256 Kbytes of free stack, before start compilation. But I'm afraid it
can be not enough sometimes.
2) If SOE throws during the first two command of compiled method, function
"unwind" of the JIT can't unwind frame correctly sometimes.




> Current implementation of DRL VM doesn't support Stack Overflow Error (SOE).
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-945
>                 URL: http://issues.apache.org/jira/browse/HARMONY-945
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Pavel Afremov
>         Attachments: 0001-This-patch-adds-support-of-Stack-Overflow-Error-SOE-for-JIT-mode-into-VM.patch
>
>
> Current implementation of DRL VM doesn't support Stack Overflow Error (SOE).
> Following example shows it:
>  
> public class Stack {
>     static int depth = 0;
>     public static void func() {
>         depth++;
>         func();
>     }
>     public static void main(String[] args) {
>         try {
>             func();
>         } catch (Throwable th) {
>             System.out.println("First SOE depth = " + depth);
>             System.out.println ("Caught = " + th);
>         }
>     }
> }
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message