JDK-6776659 : vm crash after instrumentation.retransform (via attach api)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-11-26
  • Updated: 2022-09-20
  • Resolved: 2013-08-21
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 8
8Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

FULL OS VERSION :
Microsoft Windows [Version 6.0.6000]

A DESCRIPTION OF THE PROBLEM :
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (sharedRuntime.cpp:886), pid=4516, tid=5916
#  Error: guarantee((retry_count++ < 100),"Could not resolve to latest version of redefined method")
#
# Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode, sharing windows-x86)
# An error report file with more information is saved as:
# C:\workspaces\btrace\Jinjah\hs_err_pid4516.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: No

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
start a dummy application that keeps on running
connect with attach api
in the agent do a retransform of modifiable classes (excluding all classes needed in the agent)
Retransformation instruments the code with timers
The agent starts up a jetty server. This will allow to view the timers in a browser. so fa so good.
when i connect to the jetty server, the VM crashes with above error

EXPECTED VERSUS ACTUAL BEHAVIOR :
i´d like to see method names and how log they executed
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Attached seperatly

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
agent:

public static void agentmain(String args, Instrumentation inst) {
		System.out.println("agentmain");
		main(args, inst);
	}

	private static synchronized void main(final String args,
			final Instrumentation inst) {
		if (Agent.instrumentation != null) {
			return;
		} else {
			Agent.instrumentation = inst;
		}

                [....setup system classpath.....]

		inst.addTransformer(classTransformer);
		ArrayList<Class<?>> list = GenericFactory.newArrayList();
		Class<?>[] allLoadedClasses = inst.getAllLoadedClasses();
		for (int i = 0; i < allLoadedClasses.length; i++) {
			if (inst.isModifiableClass(allLoadedClasses[i])) {
				list.add(allLoadedClasses[i]);
			}		}
		Class<?>[] rc = new Class<?>[list.size()];
		rc = list.toArray(rc);
		try {
			inst.retransformClasses(rc);
		} catch (UnmodifiableClassException e1) {
			e1.printStackTrace();
		}

		Server jetty = new Server(8080);
		jetty.addHandler(new Webview());
		try {
			jetty.start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
-Xint or -server

Comments
This bug seems to be a dup of the 6962688. Even though this bug is older I'm closing it in favor of the above as it has more relevant details.
21-08-2013