JDK-8180904 : Hotspot tests running with -agentvm failing due to classpath
  • Type: Bug
  • Component: hotspot
  • Sub-Component: test
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2017-05-24
  • Updated: 2020-08-05
  • Resolved: 2018-12-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u281Fixed 8u211 b01Fixed openjdk8u212Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Command :
./jdk1.8.0_152/bin/java -jar ./jtreg.jar -a -verbose:summary -conc:auto -ignore:quiet -timeoutFactor:5 -agentvm -dir:./jdk8u152-b04/hotspot/test -w:./hotspot -r:./hotspot gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java

or [For group run]
./jdk1.8.0_152/bin/java -jar ./jtreg.jar -a -verbose:summary -conc:auto -ignore:quiet -timeoutFactor:5 -agentvm -dir:./jdk8u152-b04/hotspot/test -w:./hotspot -r:./hotspot .

Failing test cases: 
compiler/jsr292/PollutedTrapCounts.java
compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
compiler/loopopts/UseCountedLoopSafepoints.java
compiler/types/correctness/OffTest.java
gc/TestVerifySilently.java
gc/TestVerifySubSet.java
gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
gc/class_unloading/TestG1ClassUnloadingHWM.java
gc/ergonomics/TestDynamicNumberOfGCThreads.java
gc/g1/TestEagerReclaimHumongousRegions.java
gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java
gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java
gc/g1/TestG1TraceEagerReclaimHumongousObjects.java
gc/g1/TestGCLogMessages.java
gc/g1/TestHumongousAllocInitialMark.java
gc/g1/TestPrintGCDetails.java
gc/g1/TestPrintRegionRememberedSetInfo.java
gc/g1/TestShrinkAuxiliaryData00.java
gc/g1/TestShrinkAuxiliaryData05.java
gc/g1/TestShrinkAuxiliaryData10.java
gc/g1/TestShrinkAuxiliaryData15.java
gc/g1/TestShrinkAuxiliaryData20.java
gc/g1/TestShrinkDefragmentedHeap.java
gc/g1/TestStringDeduplicationAgeThreshold.java
gc/g1/TestStringDeduplicationFullGC.java
gc/g1/TestStringDeduplicationInterned.java
gc/g1/TestStringDeduplicationPrintOptions.java
gc/g1/TestStringDeduplicationTableRehash.java
gc/g1/TestStringDeduplicationTableResize.java
gc/g1/TestStringDeduplicationYoungGC.java
gc/g1/TestStringSymbolTableStats.java
gc/logging/TestGCId.java
gc/whitebox/TestWBGC.java
runtime/ErrorHandling/TestOnOutOfMemoryError.java
runtime/NMT/JcmdWithNMTDisabled.java
runtime/memory/ReserveMemory.java
runtime/os/AvailableProcessors.java
serviceability/attach/AttachWithStalePidFile.java
serviceability/jvmti/TestRedefineWithUnresolvedClass.java

All are passing whenever run with -othervm

Failure reason: not able to load main class or inner class in the corresponding test case.
Sample error message :stderr: [Error: Could not find or load main class TestShrinkAuxiliaryData$ShrinkAuxiliaryDataTest
Issue is not there in JDK9
Comments
This issue seems to have been fixed by JDK-8077608. I've tagged that issue with jdk8u-fix-request as well.
06-03-2019

Fix Request. Oddly, there's no changeset link, will post a webrev for review.
05-03-2019

There are 42 test cases failing with the same reason. Patch to include classpath in ProcessTools will fix 41 issues. "compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java" doesn't rely on ProcessTools for its execution. Hence it need to be handled separetly. Created JDK-8215485 to address RedefineMethodUsedByMultipleMethodHandles.java failure
17-12-2018

I think all these tests are using the ProcessTools to start a new process. The problem is that the classpath is not added automatically and therefore the VM fails to find the test class (see JDK-8187806). A quick fix would be adding "-cp", System.getProperty("java.class.path"), as arguments to the process builder. [~iignatyev], what's the best way to fix this in 8u?
11-12-2018

This issue is there in 8u162 also.
11-10-2017

8u151 builds are not yet generated, I verified in JDK8u141, JDK8u122, JDK8 GA, In all of these versions tests are failing. But in JDK9 this issue is not reproducible.
25-05-2017

Can you confirm the tests pass with 8u151
24-05-2017