Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8035887

VM crashes trying to force inlining the recursive call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8
    • hotspot
    • b06

        Found in the wild:
         http://mail.openjdk.java.net/pipermail/jmh-dev/2014-February/000511.html

        Minimal test case:

        public class Test {

                public static void doCall(int claims) {
                        if (claims == 0) return;
                        doCall(claims - 1);
                }

                public static void main(String[] args) {
                        for (int i = 0; i < 10000; i++) {
                                doCall(i);
                        }
                }
        }

        Works fine on Linux x86_64, JDK 8b129 out-of-box, segfaults with forceful inlining via CompileCommand:

        $ ~/Install/jdk8b129/bin/java -XX:CompileCommand=inline,Test.doCall -XX:+PrintCompilation Test
        CompilerOracle: inline Test.doCall
             68 1 3 java.lang.String::hashCode (55 bytes)
             69 2 3 java.lang.Object::<init> (1 bytes)
             70 3 3 java.lang.String::equals (81 bytes)
             73 4 3 java.lang.String::indexOf (70 bytes)
             73 6 n 0 java.lang.System::arraycopy (native) (static)
             73 5 3 java.lang.String::charAt (29 bytes)
             74 7 3 java.lang.Math::min (11 bytes)
             74 8 3 java.lang.String::length (6 bytes)
             78 9 1 java.lang.Object::<init> (1 bytes)
             78 2 3 java.lang.Object::<init> (1 bytes) made not entrant
             78 10 3 java.util.Arrays::copyOfRange (63 bytes)
             80 11 3 Test::doCall (12 bytes)
        Segmentation fault (core dumped)

        jdk9/hs-comp also affected, *BUT ONLY THE RELEASE BUILD*, fastdebug works fine.

              vlivanov Vladimir Ivanov
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: