JDK-8043680 : RFE - add debugging info for ByteMutation and other MLVM vm testbase tests
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-05-21
  • Updated: 2016-06-24
  • Resolved: 2014-05-28
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 9
9Fixed
Related Reports
Relates :  
Description
Modify the vm testbase class, vm.mlvm.anonloader.share.StressClassLoadingTest, to save the mutated class file when the JVM crashes while running the ByteMutation test or other tests that use the StressClassLoadingTest class.

Also, provide a mechanism for specifying a specific non-random seed when trying to reproduce nightly test failures involving tests that use vm testbase class vm.mlvm.share.Env.
Comments
This fix to src/vm/mlvm/anonloader/share/StressClassLoadingTest.java was pushed to vm_testbase on 28-May-2014 @@ -13,6 +13,7 @@ public abstract class StressClassLoadingTest extends MlvmTest { private static final int MAX_PARSE_TIME_MS = 2000; + public static boolean classFileMessagePrinted = false; @SuppressWarnings("deprecation") public boolean run() throws Exception { @@ -29,14 +30,27 @@ Thread parserThread = new Thread() { public void run() { + File currClassFile = new File("_AnonkTestee01.class"); + try { try { byte[] classBytes = generateClassBytes(); + // Write out the class file being loaded. It's useful + // to have if the JVM crashes. + FileUtils.writeBytesToFile(currClassFile, classBytes); + if (!classFileMessagePrinted) { + Env.traceImportant("If the JVM crashes then the class file causing the crash is saved as _AnonkTestee01.class"); + classFileMessagePrinted = true; + } ConstantPoolParser p = new ConstantPoolParser(classBytes); p.parse(new ConstantPoolVisitor() {}); acl.loadClass(p.createPatch()).newInstance(); } catch ( Throwable e ) { Env.traceVerbose(e, "parser caught exception"); } + } finally { + // JVM did not crash. Delete the class file. + currClassFile.delete(); + } } }; parserThread.start();
28-05-2014

There already exists a mechanism for specifying a specific non-random seed, the -seed option. So, no need to add another mechanism.
28-05-2014