Skip to content
Permalink
Browse files

8240698: LingeredApp does not pass getTestJavaOpts() to the children …

…process if vmArguments is already specified

Reviewed-by: iignatyev, iklam, cjplummer
  • Loading branch information
lmesnik committed Apr 1, 2020
1 parent e08f25a commit 13af7bb9ada17b203a6683a1a1238ab5a66e9500
Showing with 112 additions and 95 deletions.
  1. +8 −4 test/hotspot/jtreg/ProblemList-aot.txt
  2. +7 −1 test/hotspot/jtreg/ProblemList-zgc.txt
  3. +5 −3 test/hotspot/jtreg/ProblemList.txt
  4. +1 −0 test/hotspot/jtreg/resourcehogs/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java
  5. +1 −13 test/hotspot/jtreg/resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java
  6. +14 −3 test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java
  7. +6 −7 test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java
  8. +13 −3 test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java
  9. +14 −3 test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java
  10. +1 −3 test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java
  11. +1 −4 test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java
  12. +1 −3 test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java
  13. +1 −5 test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java
  14. +1 −5 test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java
  15. +1 −2 test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java
  16. +1 −1 test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java
  17. +1 −4 test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java
  18. +1 −3 test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java
  19. +1 −2 test/jdk/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
  20. +3 −2 test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java
  21. +4 −4 test/jdk/sun/tools/jinfo/JInfoTest.java
  22. +26 −20 test/lib/jdk/test/lib/apps/LingeredApp.java
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -32,20 +32,24 @@ serviceability/sa/ClhsdbAttach.java 8216181 generic-all
serviceability/sa/ClhsdbCDSCore.java 8216181 generic-all
serviceability/sa/ClhsdbCDSJstackPrintAll.java 8216181 generic-all
serviceability/sa/ClhsdbField.java 8216181 generic-all
serviceability/sa/ClhsdbFindPC.java 8216181 generic-all
serviceability/sa/ClhsdbFindPC.java#id0 8216181 generic-all
serviceability/sa/ClhsdbFindPC.java#id1 8216181 generic-all
serviceability/sa/ClhsdbFlags.java 8216181 generic-all
serviceability/sa/ClhsdbInspect.java 8216181 generic-all
serviceability/sa/ClhsdbJdis.java 8216181 generic-all
serviceability/sa/ClhsdbJhisto.java 8216181 generic-all
serviceability/sa/ClhsdbJstack.java 8216181 generic-all
serviceability/sa/ClhsdbJstack.java#id0 8216181 generic-all
serviceability/sa/ClhsdbJstack.java#id1 8216181 generic-all
serviceability/sa/ClhsdbJstackXcompStress.java 8216181 generic-all
serviceability/sa/ClhsdbLongConstant.java 8216181 generic-all
serviceability/sa/ClhsdbPmap.java 8216181 generic-all
serviceability/sa/ClhsdbPrintAll.java 8216181 generic-all
serviceability/sa/ClhsdbPrintAs.java 8216181 generic-all
serviceability/sa/ClhsdbPrintStatics.java 8216181 generic-all
serviceability/sa/ClhsdbPstack.java 8216181 generic-all
serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 8216181 generic-all
serviceability/sa/ClhsdbScanOops.java 8216181 generic-all
serviceability/sa/ClhsdbScanOops.java#id0 8216181 generic-all
serviceability/sa/ClhsdbScanOops.java#id1 8216181 generic-all
serviceability/sa/ClhsdbSource.java 8216181 generic-all
serviceability/sa/ClhsdbThread.java 8216181 generic-all
serviceability/sa/ClhsdbVmStructsDump.java 8216181 generic-all
@@ -28,10 +28,16 @@
#############################################################################

resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8220624 generic-all
serviceability/sa/CDSJMapClstats.java 8220624 generic-all
serviceability/sa/ClhsdbCDSJstackPrintAll.java 8220624 generic-all
serviceability/sa/ClhsdbFindPC.java#id0 8220624 generic-all
serviceability/sa/ClhsdbFindPC.java#id1 8220624 generic-all
serviceability/sa/ClhsdbInspect.java 8220624 generic-all
serviceability/sa/ClhsdbJdis.java 8220624 generic-all
serviceability/sa/ClhsdbJhisto.java 8220624 generic-all
serviceability/sa/ClhsdbJstack.java 8220624 generic-all
serviceability/sa/ClhsdbJstack.java#id0 8220624 generic-all
serviceability/sa/ClhsdbJstack.java#id1 8220624 generic-all
serviceability/sa/ClhsdbJstackXcompStress.java 8220624 generic-all
serviceability/sa/ClhsdbPrintAs.java 8220624 generic-all
serviceability/sa/ClhsdbPrintStatics.java 8220624 generic-all
serviceability/sa/ClhsdbPstack.java 8220624 generic-all
@@ -103,7 +103,8 @@ serviceability/sa/ClhsdbCDSCore.java 8193639 solaris-all
serviceability/sa/ClhsdbCDSJstackPrintAll.java 8193639 solaris-all
serviceability/sa/CDSJMapClstats.java 8193639 solaris-all
serviceability/sa/ClhsdbField.java 8193639 solaris-all
serviceability/sa/ClhsdbFindPC.java 8193639 solaris-all
serviceability/sa/ClhsdbFindPC.java#id0 8193639 solaris-all
serviceability/sa/ClhsdbFindPC.java#id1 8193639 solaris-all
serviceability/sa/ClhsdbFlags.java 8193639 solaris-all
serviceability/sa/ClhsdbInspect.java 8193639 solaris-all
serviceability/sa/ClhsdbJdis.java 8193639 solaris-all
@@ -117,15 +118,16 @@ serviceability/sa/ClhsdbPrintAs.java 8193639 solaris-all
serviceability/sa/ClhsdbPrintStatics.java 8193639 solaris-all
serviceability/sa/ClhsdbPstack.java 8193639 solaris-all
serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 8193639 solaris-all
serviceability/sa/ClhsdbScanOops.java 8193639,8235220,8230731 solaris-all,linux-x64,macosx-x64,windows-x64
serviceability/sa/ClhsdbScanOops.java#id0 8193639,8235220,8230731 solaris-all,linux-x64,macosx-x64,windows-x64
serviceability/sa/ClhsdbScanOops.java#id1 8193639,8235220,8230731 solaris-all,linux-x64,macosx-x64,windows-x64
serviceability/sa/ClhsdbSource.java 8193639 solaris-all
serviceability/sa/ClhsdbThread.java 8193639 solaris-all
serviceability/sa/ClhsdbVmStructsDump.java 8193639 solaris-all
serviceability/sa/ClhsdbWhere.java 8193639 solaris-all
serviceability/sa/DeadlockDetectionTest.java 8193639 solaris-all
serviceability/sa/JhsdbThreadInfoTest.java 8193639 solaris-all
serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 8193639 solaris-all
serviceability/sa/sadebugd/DebugdConnectTest.java 8239062 macosx-x64
serviceability/sa/sadebugd/DebugdConnectTest.java 8239062 macosx-x64
serviceability/sa/TestClassDump.java 8193639 solaris-all
serviceability/sa/TestClhsdbJstackLock.java 8193639 solaris-all
serviceability/sa/TestCpoolForInvokeDynamic.java 8193639 solaris-all
@@ -25,6 +25,7 @@
* @test
* @bug 8175312
* @summary Test clhsdb 'g1regiondetails' and 'scanoops' commands for G1GC
* @requires vm.gc.G1
* @requires vm.hasSA & (vm.bits == "64" & os.maxMemory > 8g)
* @library /test/lib /test/hotspot/jtreg/serviceability/sa
* @run main/othervm/timeout=2400 ClhsdbRegionDetailsScanOopsForG1
@@ -21,23 +21,11 @@
* questions.
*/

import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.nio.file.Files;
import java.io.IOException;
import java.io.BufferedInputStream;
import java.util.stream.Collectors;
import java.io.FileInputStream;

import sun.jvm.hotspot.HotSpotAgent;
import sun.jvm.hotspot.debugger.*;

import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.Asserts;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.Platform;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.SA.SATestUtils;
@@ -104,7 +92,7 @@ public static void main (String... args) throws Exception {
"-Xmx8g");

theApp = new LingeredAppWithLargeArray();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startAppExactJvmOpts(theApp, vmArgs);
attachAndDump(heapDumpFileName, theApp.getPid());
} finally {
LingeredApp.stopApp(theApp);
@@ -36,7 +36,18 @@
* @requires vm.hasSA
* @requires vm.compiler1.enabled
* @library /test/lib
* @run main/othervm/timeout=480 ClhsdbFindPC
* @run main/othervm/timeout=480 ClhsdbFindPC true
*/

/**
* @test
* @bug 8193124
* @summary Test the clhsdb 'findpc' command
* @requires vm.compMode != "Xcomp"
* @requires vm.hasSA
* @requires vm.compiler1.enabled
* @library /test/lib
* @run main/othervm/timeout=480 ClhsdbFindPC false
*/

public class ClhsdbFindPC {
@@ -104,9 +115,9 @@ private static void testFindPC(boolean withXcomp) throws Exception {
}

public static void main(String[] args) throws Exception {
boolean xComp = Boolean.parseBoolean(args[0]);
System.out.println("Starting the ClhsdbFindPC test");
testFindPC(true);
testFindPC(false);
testFindPC(xComp);
System.out.println("Test PASSED");
}
}
@@ -21,7 +21,6 @@
* questions.
*/

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -49,11 +48,10 @@ public static void runBasicTest() throws Exception {
LingeredApp theApp = null;
try {
ClhsdbLauncher test = new ClhsdbLauncher();
String[] vmArgs = Utils.appendTestJavaOpts(
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:-MaxFDLimit");
theApp = LingeredApp.startApp(vmArgs);
theApp = LingeredApp.startApp(
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:-MaxFDLimit");
System.out.println("Started LingeredApp with pid " + theApp.getPid());

List<String> cmds = List.of(
@@ -111,7 +109,8 @@ public static void runAllTypesTest() throws Exception {
"-XX:OnError='echo error'", // ccstrlist
"-XX:CompileThresholdScaling=1.0", // double
"-XX:ErrorLogTimeout=120"); // uint64_t
theApp = LingeredApp.startApp(vmArgs);
theApp = new LingeredApp();
LingeredApp.startAppExactJvmOpts(theApp, vmArgs);
System.out.println("Started LingeredApp with pid " + theApp.getPid());

List<String> cmds = List.of("flags");
@@ -34,7 +34,17 @@
* @summary Test clhsdb Jstack command
* @requires vm.hasSA
* @library /test/lib
* @run main/othervm/timeout=480 ClhsdbJstack
* @run main/othervm/timeout=480 ClhsdbJstack true
*/

/**
* @test
* @bug 8190198
* @requires vm.compMode != "Xcomp"
* @summary Test clhsdb Jstack command
* @requires vm.hasSA
* @library /test/lib
* @run main/othervm/timeout=480 ClhsdbJstack false
*/

public class ClhsdbJstack {
@@ -74,9 +84,9 @@ private static void testJstack(boolean withXcomp) throws Exception {
}

public static void main(String[] args) throws Exception {
boolean xComp = Boolean.parseBoolean(args[0]);
System.out.println("Starting ClhsdbJstack test");
testJstack(false);
testJstack(true);
testJstack(xComp);
System.out.println("Test PASSED");
}
}
@@ -25,9 +25,20 @@
* @test
* @bug 8192985
* @summary Test the clhsdb 'scanoops' command
* @requires vm.gc.ParallelGC
* @requires vm.hasSA
* @library /test/lib
* @run main/othervm/timeout=1200 ClhsdbScanOops
* @run main/othervm/timeout=1200 ClhsdbScanOops UseParallelGC
*/

/**
* @test
* @bug 8192985
* @summary Test the clhsdb 'scanoops' command
* @requires vm.gc.SerialGC
* @requires vm.hasSA
* @library /test/lib
* @run main/othervm/timeout=1200 ClhsdbScanOops UseSerialGC
*/

import java.util.HashMap;
@@ -99,9 +110,9 @@ private static void testWithGcType(String gc) throws Exception {
}

public static void main(String[] args) throws Exception {
String gc = args[0];
System.out.println("Starting the ClhsdbScanOops test");
testWithGcType("-XX:+UseParallelGC");
testWithGcType("-XX:+UseSerialGC");
testWithGcType("-XX:+" + gc);
System.out.println("Test PASSED");
}
}
@@ -77,10 +77,8 @@ public static void main(String[] args) throws Exception {
}

try {
String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");

theApp = new LingeredAppWithDeadlock();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startApp(theApp, "-XX:+UsePerfData");
OutputAnalyzer output = jstack("--pid", Long.toString(theApp.getPid()));
System.out.println(output.getOutput());

@@ -125,11 +125,8 @@ public static void main (String... args) throws Exception {

if (args == null || args.length == 0) {
try {
String[] vmArgs = Utils.appendTestJavaOpts(
"-XX:+UsePerfData");

theApp = new LingeredAppWithInvokeDynamic();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startApp(theApp, "-XX:+UsePerfData");
createAnotherToAttach(instanceKlassNames,
theApp.getPid());
} finally {
@@ -135,10 +135,8 @@ public static void main (String... args) throws Exception {

if (args == null || args.length == 0) {
try {
String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");

theApp = new LingeredAppWithDefaultMethods();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startApp(theApp, "-XX:+UsePerfData");
createAnotherToAttach(instanceKlassNames,
theApp.getPid());
} finally {
@@ -93,12 +93,8 @@ public static void main (String... args) throws Exception {
SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
if (args == null || args.length == 0) {
try {
String[] vmArgs = Utils.appendTestJavaOpts(
"-XX:+UsePerfData",
"-XX:+UseG1GC");

theApp = new LingeredApp();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startApp(theApp, "-XX:+UsePerfData", "-XX:+UseG1GC");
createAnotherToAttach(theApp.getPid());
} finally {
LingeredApp.stopApp(theApp);
@@ -121,12 +121,8 @@ public static void main (String... args) throws Exception {
}

try {
String[] vmArgs = Utils.appendTestJavaOpts(
"-XX:+UsePerfData",
"-Xmx512m");

theApp = new LingeredAppWithInvokeDynamic();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startApp(theApp, "-XX:+UsePerfData", "-Xmx512m");
attachDumpAndVerify(heapDumpFileName, theApp.getPid());
} finally {
LingeredApp.stopApp(theApp);
@@ -74,8 +74,7 @@ private static void startMeWithArgs() throws Exception {
LingeredApp app = null;
OutputAnalyzer output = null;
try {
String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
app = LingeredApp.startApp(vmArgs);
app = LingeredApp.startApp("-XX:+UsePerfData");
System.out.println ("Started LingeredApp with pid " + app.getPid());
} catch (Exception ex) {
ex.printStackTrace();
@@ -172,7 +172,7 @@ public static void main(String... args) throws Exception {
: Utils.getTestJavaOpts();

app = new LingeredAppWithNativeMethod();
LingeredApp.startApp(app, vmArgs);
LingeredApp.startAppExactJvmOpts(app, vmArgs);
System.out.println("Started LingeredApp with pid " + app.getPid());
runJstackMixedInLoop(app);
System.out.println("Test Completed");
@@ -45,10 +45,7 @@ public static void main (String... args) throws Exception {
LingeredApp app = null;
try {
ClhsdbLauncher test = new ClhsdbLauncher();
String[] vmArgs = Utils.appendTestJavaOpts(
"-XX:+ProfileInterpreter");

app = LingeredApp.startApp(vmArgs);
app = LingeredApp.startApp("-XX:+ProfileInterpreter");
System.out.println ("Started LingeredApp with pid " + app.getPid());
List<String> cmds = List.of("printmdo -a");

@@ -85,10 +85,8 @@ public static void main (String... args) throws Exception {
SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
if (args == null || args.length == 0) {
try {
String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");

theApp = new LingeredAppWithInvokeDynamic();
LingeredApp.startApp(theApp, vmArgs);
LingeredApp.startApp(theApp, "-XX:+UsePerfData");
createAnotherToAttach(theApp.getPid());
} finally {
LingeredApp.stopApp(theApp);
@@ -54,8 +54,7 @@ public static void main(String[] args) throws IOException,
MonitorException, URISyntaxException {
LingeredApp app = null;
try {
String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
app = LingeredApp.startApp(vmArgs);
app = LingeredApp.startApp("-XX:+UsePerfData");

MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
String uriString = "//" + app.getPid() + "?mode=r"; // NOI18N
@@ -99,7 +99,8 @@ public int launch(String... vmArgs) {
List<String> vmArgsExtended = new ArrayList<String>();
vmArgsExtended.add("-XX:+UsePerfData");
Collections.addAll(vmArgsExtended, vmArgs);
theApp = LingeredApp.startApp(vmArgsExtended.toArray(new String[0]));
theApp = new LingeredApp();
LingeredApp.startAppExactJvmOpts(theApp, vmArgsExtended.toArray(new String[0]));

System.out.println("Starting " + toolName + " against " + theApp.getPid());
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
@@ -112,7 +113,7 @@ public int launch(String... vmArgs) {
launcher.addToolArg(Long.toString(theApp.getPid()));

ProcessBuilder processBuilder = SATestUtils.createProcessBuilder(launcher);
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
Process toolProcess = processBuilder.start();

// By default child process output stream redirected to pipe, so we are reading it in foreground.

0 comments on commit 13af7bb

Please sign in to comment.