The handling of StackOverflowError in OpenJ9 and HotSpot is different

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 17.0.12
    • Component/s: hotspot

      ADDITIONAL SYSTEM INFORMATION :
      - OS: Linux 5.8.0-63-generic, x86_64
      - CPU: amd64, 48 logical CPUs
      - Build GCC: 9.4

      A DESCRIPTION OF THE PROBLEM :
      When I run the following program, Openj9 (17) and OpenJDK (17.0.12 release) will have different results. It seems that the handling of StackOverflowError is different

      OpenJ9 : java -Xshareclasses:none Test :
      m1 run
      TEST FINISHED

      OpenJDK Hotspot: jdk-17.0.12/bin/java Test:
      TEST FINISHED

      ---------- BEGIN SOURCE ----------
      public class Test {
          static class UnloadedClass1 {
              volatile int field;
          }
          static java.lang.Object m1(boolean deopt) {
              System.out.println("m1 run");
              return null;
          }
          static boolean m2(boolean deopt) {
              
              boolean do_m3 = false;
              try {
                  do_m3 = Test.m2(deopt);
              } catch (java.lang.StackOverflowError e) {
                  return true;
              }
              if (do_m3) {
                  try {
                      Test.m1(deopt);
                  } catch (java.lang.StackOverflowError e) {
                  }
              }
              return false;
          }
          
          public static void main(java.lang.String[] args) {
              Test.m2(true);
              java.lang.System.out.println("TEST FINISHED");
          }
      }

      ---------- END SOURCE ----------

      FREQUENCY :
      ALWAYS

            Assignee:
            Unassigned
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: