test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java
author azeller
Tue, 24 Sep 2019 14:46:38 +0200
changeset 58336 8573d94a3a00
parent 54607 b6db97903b69
permissions -rw-r--r--
8230110: TestLinkageErrorInGenerateOopMap times out Reviewed-by: stuefe, clanger, thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47822
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     1
/*
53853
7ca9e625d6b2 8214719: Deprecate -Xverify:none option
hseigel
parents: 47822
diff changeset
     2
 * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
47822
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     4
 *
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     8
 *
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    13
 * accompanied this code).
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    14
 *
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    18
 *
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    21
 * questions.
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    22
 */
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    23
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    24
/*
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    25
 * @test
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    26
 * @bug 8190797
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    27
 * @summary Test OSR compilation with bad operand stack.
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    28
 * @library /test/lib /
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    29
 * @modules java.base/jdk.internal.misc
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    30
 *          java.management
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    31
 * @compile OSRWithBadOperandStack.jasm
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    32
 * @run driver compiler.linkage.TestLinkageErrorInGenerateOopMap
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    33
 */
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    34
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    35
package compiler.linkage;
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    36
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    37
import jdk.test.lib.process.OutputAnalyzer;
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    38
import jdk.test.lib.process.ProcessTools;
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    39
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    40
public class TestLinkageErrorInGenerateOopMap {
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    41
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    42
    public static void main(String args[]) throws Exception {
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    43
        if (args.length == 0) {
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    44
            // Spawn new VM instance to execute test
54607
b6db97903b69 8221685: -XX:BytecodeVerificationRemote and -XX:BytecodeVerificationLocal should be diagnostic options
hseigel
parents: 53853
diff changeset
    45
            String[] flags = {"-XX:+UnlockDiagnosticVMOptions",
b6db97903b69 8221685: -XX:BytecodeVerificationRemote and -XX:BytecodeVerificationLocal should be diagnostic options
hseigel
parents: 53853
diff changeset
    46
                              "-XX:-BytecodeVerificationRemote",
53853
7ca9e625d6b2 8214719: Deprecate -Xverify:none option
hseigel
parents: 47822
diff changeset
    47
                              "-XX:-BytecodeVerificationLocal",
7ca9e625d6b2 8214719: Deprecate -Xverify:none option
hseigel
parents: 47822
diff changeset
    48
                              "-XX:-TieredCompilation",
47822
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    49
                              "-XX:CompileCommand=dontinline,compiler/linkage/OSRWithBadOperandStack.m*",
58336
8573d94a3a00 8230110: TestLinkageErrorInGenerateOopMap times out
azeller
parents: 54607
diff changeset
    50
                              "-XX:-CreateCoredumpOnCrash",
8573d94a3a00 8230110: TestLinkageErrorInGenerateOopMap times out
azeller
parents: 54607
diff changeset
    51
                              "-Xmx64m",
47822
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    52
                              "compiler.linkage.TestLinkageErrorInGenerateOopMap", "run"};
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    53
            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flags);
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    54
            OutputAnalyzer out = new OutputAnalyzer(pb.start());
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    55
            if (out.getExitValue() != 0) {
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    56
                // OSR compilation should exit with an error during OopMap verification
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    57
                // because a LinkageError cannot be thrown from a compiler thread.
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    58
                out.shouldContain("fatal error: Illegal class file encountered");
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    59
            }
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    60
        } else {
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    61
            // Execute test
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    62
            OSRWithBadOperandStack.test();
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    63
        }
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    64
    }
7437dc810834 8190797: OSR compilation fails with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread"
thartmann
parents:
diff changeset
    65
}