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/27 16:59:26 UTC

[jira] Created: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

[drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
----------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4292
                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Windows
            Reporter: Vera Petrashkova


The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
when  synchronized method is invoked recursively
--------------------------recTest.java------------------
public class recTest {

    public static void main(String[] args) {
        new recTest().test();
    }

    private static int count;

    public void test() {
        try {
            func();
            System.err.println("TEST FAILED. SOE was not thrown");
        } catch (StackOverflowError e) {
            if (count > 255) {
                System.err.println("TEST PASSED, count=" + count);
            } else {
                System.err.println("TEST FAILED: too short stack ("
                                + count + ")");
            }
        }
    }

    private synchronized  void func() {
        count++;
        func();
    }
}
----------------------------------------------
Output on Jitrino.opt
===============
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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
http://harmony.apache.org


Output on Jitrino.jet 
===============
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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
http://harmony.apache.org
TEST PASSED, count=4169


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Gregory Shimansky commented on HARMONY-4292:
--------------------------------------------

The patch looks ok to me. I think however that if there is a contract with VM as you write, it should be also commented on the JIT side if there is such place. From the patch it looks as the contract is only in VM with JIT.

> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>         Attachments: soe1.patch
>
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Mikhail Fursov commented on HARMONY-4292:
-----------------------------------------

soe1.fix was committed as r 564567
The problem is fixed on Windows now but I can reproduce it on Linux.
Continuing investigation...



> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>         Attachments: soe1.patch
>
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Mikhail Fursov updated HARMONY-4292:
------------------------------------

    Attachment: s3.diff

s3.diff:
In this fix I reworked the way monexit is called on exception propagation. First patch was good for Windows, but not for Linux.
In this patch I added special optional method to VM-JIT interface: 'is_soe_area' and if exception happened in this area no monexit is called for synchronized method.

please review.

> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>         Attachments: s3.diff, soe1.patch
>
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Mikhail Fursov updated HARMONY-4292:
------------------------------------

    Attachment: soe1.patch

soe1.fix: a contract with VM: do not call monexit if SOE happens in synchronized method

> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>         Attachments: soe1.patch
>
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Gregory Shimansky commented on HARMONY-4292:
--------------------------------------------

I looked at the patch and I think it is good. Please commit if acceptance tests work ok.

> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>         Attachments: s3.diff, soe1.patch
>
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Mikhail Fursov reassigned HARMONY-4292:
---------------------------------------

    Assignee: Mikhail Fursov

> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Mikhail Fursov resolved HARMONY-4292.
-------------------------------------

    Resolution: Fixed

Committed revision 565339

> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>            Assignee: Mikhail Fursov
>         Attachments: s3.diff, soe1.patch
>
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4292) [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing StackOverfowError when synchronized method is invoked recursively

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

Pavel Ozhdikhin commented on HARMONY-4292:
------------------------------------------

The test looks similar to MyStack2.java from HARMONY-3010.


> [drlvm][jit][opt] Jitrino.OPT crashes instead of throwing  StackOverfowError when synchronized method is invoked recursively
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4292
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4292
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows
>            Reporter: Vera Petrashkova
>
> The following test demonstrates that Jitrino.OPT crashes instead of throwing StackOverflowError 
> when  synchronized method is invoked recursively
> --------------------------recTest.java------------------
> public class recTest {
>     public static void main(String[] args) {
>         new recTest().test();
>     }
>     private static int count;
>     public void test() {
>         try {
>             func();
>             System.err.println("TEST FAILED. SOE was not thrown");
>         } catch (StackOverflowError e) {
>             if (count > 255) {
>                 System.err.println("TEST PASSED, count=" + count);
>             } else {
>                 System.err.println("TEST FAILED: too short stack ("
>                                 + count + ")");
>             }
>         }
>     }
>     private synchronized  void func() {
>         count++;
>         func();
>     }
> }
> ----------------------------------------------
> Output on Jitrino.opt
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> Output on Jitrino.jet 
> ===============
> 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 = r550333, (Jun 25 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST PASSED, count=4169

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.