-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b56
-
sparc
-
solaris_9
Name: tb29552 Date: 05/26/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
SunOS mary 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Blade-100
A DESCRIPTION OF THE PROBLEM :
SIGSEGV when instantiating a class redefined through java.lang.instrument.Instrumentation.redefineClass()
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile and run the program given with
java -javaagent:Teste Teste
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The following output is expected:
Integer
Button
ACTUAL -
Integer
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xfe93b930, pid=27942, tid=6
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0-beta-b32c mixed mode)
# Problematic frame:
# V [libjvm.so+0x13b930]
#
# An error report file with more information is saved as hs_err_pid27942.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Abort
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.lang.instrument.*;
import java.io.*;
public class Teste {
static Instrumentation instrumentation;
public static void main(String[] args) throws Exception {
redefine(java.lang.Integer.class);
new java.lang.Integer(0);
System.out.println("Integer");
redefine(java.awt.Button.class);
new java.awt.Button();
System.out.println("Button");
}
public static void premain(String agentArgs, Instrumentation instr) {
instrumentation = instr;
}
public static void redefine(Class cl) throws Exception {
ClassLoader cloader = cl.getClassLoader();
if (cloader == null) {
cloader = ClassLoader.getSystemClassLoader();
}
String className = cl.getName().replace('.', '/') + ".class";
InputStream is = cloader.getResourceAsStream(className);
if (is == null) throw new RuntimeException();
ByteArrayOutputStream bo = new ByteArrayOutputStream();
for(int n = is.read(); n != -1; n = is.read()) {
bo.write(n);
}
instrumentation.redefineClasses(new ClassDefinition[] {
new ClassDefinition(cl, bo.toByteArray()) });
}
}
---------- END SOURCE ----------
(Incident Review ID: 275122)
======================================================================
- relates to
-
JDK-4963527 Linux: assert(!m->is_old_version(),"attempt to find vtable index of old method")
-
- Resolved
-