harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5790) [drlvm][interpreter] Stack size is not enough
Date Thu, 24 Apr 2008 16:33:25 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vasily Zakharov updated HARMONY-5790:
-------------------------------------

    Description: 
The following simple test sometimes causes a stack overflow.

public class Test {
    static interface Sample1 {
        public <T extends Sample1, E extends Throwable> T test(T param) throws E;
    }
    static interface Sample2 {
        public <T extends Sample2, E extends Throwable> T test(T param) throws E;
    }
    static boolean success;
    public static void main(String[] args) {
        try {
            Sample1.class.getMethods()[0].getGenericParameterTypes();
            System.out.println("Main thread: OK");
        } catch (StackOverflowError e) {
            System.out.println("Main thread: ERROR: ");
            e.printStackTrace(System.out);
        }
        success = false;
        Thread thread = new Thread() {
            public void run() {
                try {
                    Sample2.class.getMethods()[0].getGenericParameterTypes();
                    System.out.println("Child thread: OK");
                } catch (Throwable e) {
                    System.out.println("Child thread: ERROR: ");
                    e.printStackTrace(System.out);
                }
            }
        };
        thread.start();
    }
}

As the test is very simple and only makes a one trivial reflection call in main and child
threads, it seems evident that stack size is just not enough for the Interpreter to work and
needs to be increased.

The error was discovered as test java.lang.reflect.MethodTest.test_getGeneric(), that is a
regression test for HARMONY-5622, was failing in main thread on Windows/64, and in a separate
thread on Linux/32:

http://people.apache.org/~smishura/r650380/Linux_x86/drlvm-test/

Now the test is commented out, but the proper fix would be to increase the stack size in interpreter
mode and uncomment the test.


  was:
The following simple test sometimes causes a stack overflow.

public class Test {
    static interface Sample1 {
        public <T extends Sample1, E extends Throwable> T test(T param) throws E;
    }
    static interface Sample2 {
        public <T extends Sample2, E extends Throwable> T test(T param) throws E;
    }
    static boolean success;
    public static void main(String[] args) {
        try {
            Sample1.class.getMethods()[0].getGenericParameterTypes();
            System.out.println("Main thread: OK");
        } catch (StackOverflowError e) {
            System.out.println("Main thread: ERROR: ");
            e.printStackTrace(System.out);
        }
        success = false;
        Thread thread = new Thread() {
            public void run() {
                try {
                    Sample2.class.getMethods()[0].getGenericParameterTypes();
                    System.out.println("Child thread: OK");
                } catch (Throwable e) {
                    System.out.println("Child thread: ERROR: ");
                    e.printStackTrace(System.out);
                }
            }
        };
        thread.start();
    }
}

As the test is very simple and only makes a one trivial reflection call in main and child
threads, it seems evident that stack size is just not enough for the Interpreter to work and
needs to be increased.

The error was discovered as test java.lang.reflect.MethodTest.test_getGeneric(), that is a
regression test for HARMONY-5622 was failing in main thread on Windows/64, and in a separate
thread on Linux/32.

Now the test is commented out, but the proper fix would be to increase the stack size in interpreter
mode and uncomment the test.



> [drlvm][interpreter] Stack size is not enough
> ---------------------------------------------
>
>                 Key: HARMONY-5790
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5790
>             Project: Harmony
>          Issue Type: Bug
>          Components: build - test - ci, DRLVM
>    Affects Versions: 5.0M5
>         Environment: Linux/32, Windows/64, Interpreter
>            Reporter: Vasily Zakharov
>
> The following simple test sometimes causes a stack overflow.
> public class Test {
>     static interface Sample1 {
>         public <T extends Sample1, E extends Throwable> T test(T param) throws
E;
>     }
>     static interface Sample2 {
>         public <T extends Sample2, E extends Throwable> T test(T param) throws
E;
>     }
>     static boolean success;
>     public static void main(String[] args) {
>         try {
>             Sample1.class.getMethods()[0].getGenericParameterTypes();
>             System.out.println("Main thread: OK");
>         } catch (StackOverflowError e) {
>             System.out.println("Main thread: ERROR: ");
>             e.printStackTrace(System.out);
>         }
>         success = false;
>         Thread thread = new Thread() {
>             public void run() {
>                 try {
>                     Sample2.class.getMethods()[0].getGenericParameterTypes();
>                     System.out.println("Child thread: OK");
>                 } catch (Throwable e) {
>                     System.out.println("Child thread: ERROR: ");
>                     e.printStackTrace(System.out);
>                 }
>             }
>         };
>         thread.start();
>     }
> }
> As the test is very simple and only makes a one trivial reflection call in main and child
threads, it seems evident that stack size is just not enough for the Interpreter to work and
needs to be increased.
> The error was discovered as test java.lang.reflect.MethodTest.test_getGeneric(), that
is a regression test for HARMONY-5622, was failing in main thread on Windows/64, and in a
separate thread on Linux/32:
> http://people.apache.org/~smishura/r650380/Linux_x86/drlvm-test/
> Now the test is commented out, but the proper fix would be to increase the stack size
in interpreter mode and uncomment the test.

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