JDK-8209736 : runtime/RedefineTests/ModifyAnonymous.java fails with NullPointerException when running in CDS mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-08-20
  • Updated: 2022-06-10
  • Resolved: 2018-09-04
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 11 JDK 12
11.0.17-oracleFixed 12 b10Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Description
The runtime/RedefineTests/ModifyAnonymous.java fails with NullPointerException when running on a JDK binary with an existing CDS binary:

java.lang.NullPointerException
	at ModifyAnonymous.runTest(ModifyAnonymous.java:113)
	at ModifyAnonymous$1.run(ModifyAnonymous.java:156)
STATUS:Failed.`main' threw exception: java.lang.NullPointerException
Comments
Fix request [11u] I backport this for parity with 11.0.17-oracle. No risk, only a test change. Clean backport. Test passes. SAP nightly testing passed.
10-06-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/1134 Date: 2022-06-09 10:38:04 +0000
09-06-2022

Git URL: https://github.com/openjdk/jdk/commit/3c810ce261980692877a0b043bc67a910902bd26
09-06-2022

URL: http://hg.openjdk.java.net/jdk/jdk/rev/ab722555e66d User: ccheung Date: 2018-09-04 22:00:32 +0000
04-09-2018

Unable to reproduce the problem locally on linux so far. java.lang.NullPointerException at ModifyAnonymous.runTest(ModifyAnonymous.java:113) is the following line: static void runTest() { while (!done) { Class[] allLoadedClasses = inst.getAllLoadedClasses(); for (Class clazz : allLoadedClasses) { final String name = clazz.getName(); <<<--- line 113 This means a null clazz. From the log: ----------System.out:(2/25)---------- javaagent in da house! . This indicates the InstanceMethodCallSiteApp.doWork thread didn't run for too long. The output for a successful run should look like: ----------System.out:(6/511)---------- javaagent in da house! .....retransform called for ModifyAnonymous$InstanceMethodCallSiteApp$$Lambda$17/0x0000000840066840 PASSED: expecting UnmodifiableClassException redefine called for ModifyAnonymous$InstanceMethodCallSiteApp$$Lambda$17/0x0000000840066840 .....................................................................................................................................................................PASSED: expecting UnmodifiableClassException PASSED: NoClassDefFound error not thrown
24-08-2018