Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-5790

[drlvm][interpreter] Stack size is not enough

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0M5
    • None
    • build - test - ci, DRLVM
    • None
    • Linux/32, Windows/64, Interpreter

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vmz Vasily Zakharov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: