United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4927116 Regression: 1.4.2 JVM core dumps in ClassLoader.defineClass0()
JDK-4927116 : Regression: 1.4.2 JVM core dumps in ClassLoader.defineClass0()

Details
Type:
Bug
Submit Date:
2003-09-24
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2003-10-17
Component:
hotspot
OS:
solaris_9,linux_redhat_7.2
Sub-Component:
runtime
CPU:
x86,sparc
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
1.4.2_04 (04)

Related Reports
Backport:
Duplicate:

Sub Tasks

Description
rtel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/libzip.so
0xfbed0000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/libnet.so
0xd3830000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/librmi.so
0xd3810000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/libioser12.so

Heap at VM Abort:
Heap
 def new generation   total 42560K, used 32926K [0xd5800000, 0xd82d0000, 0xe02a0000)
  eden space 41280K,  79% used [0xd5800000, 0xd7827a78, 0xd8050000)
  from space 1280K,   0% used [0xd8050000, 0xd8050000, 0xd8190000)
  to   space 1280K,   0% used [0xd8190000, 0xd8190000, 0xd82d0000)
 tenured generation   total 87424K, used 12080K [0xe02a0000, 0xe5800000, 0xf5800000)
   the space 87424K,  13% used [0xe02a0000, 0xe0e6c3c8, 0xe0e6c400, 0xe5800000)
 compacting perm gen  total 16384K, used 15387K [0xf5800000, 0xf6800000, 0xf9800000)
   the space 16384K,  93% used [0xf5800000, 0xf6706db0, 0xf6706e00, 0xf6800000)

Local Time = Fri Sep 19 15:06:34 2003
Elapsed Time = 199
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF 01
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.2-b28 mixed mode)
#
Operating System: Solaris 
    OS version: 9 
    Product Name: J2SE 
    Product version: 1.4.2-b28 mixed mode

Short description: JVM core dumps in ClassLoader.defineClass0().

Full problem description: 

We are running JBOSS 3.2.1.  When we have duplicate class, we get the following error message 
              java.lang.LinkageError: duplicate class definition:
    com/nortel/mftP/dmlP/modelP/faultP/workflowP/AlarmClearWorkflowC

and shortly after the JVM core dumps. However, we dont see this
behavor with J2SE 1.4.0 or 1.4.1_05. This is 1.4.2 specific.

Unexpected Signal : 11 occurred at PC=0xFED3F96C
Function=[Unknown. Nearest: JVM_GetCPMethodNameUTF+0x3C48]
Library=/opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/server/libjvm.so

Current Java thread:
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xd65aa490> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:401)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:242)
        at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:114)
        at org.jboss.mx.loading.LoadMgr.nextTask(LoadMgr.java:281)
        at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:181)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        - locked <0xe08b5578> (a org.jboss.mx.loading.UnifiedClassLoader3)
        at com.nortel.mftP.dmlP.modelP.faultP.testP.AlarmValueMakerC.makeMinimallyPopulatedAlarm(AlarmValueMakerC.java:118)
        at com.nortel.mftP.dmlP.modelP.faultP.testP.AlarmValueMakerC.makeFullyPopulatedAlarmValue(AlarmValueMakerC.java:64)
        at com.nortel.mftP.dmlP.modelP.faultP.testP.FMSTestSupportSessionBean.runClient(FMSTestSupportSessionBean.java:238)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
        at org.jboss.ejb.Container.invoke(Container.java:674)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:534)

Dynamic libraries:
0x10000         /opt/nortel/3rd_party/java/current_j2sdk/bin/java
0xff370000      /usr/lib/libthread.so.1
0xff3a0000      /usr/lib/libdl.so.1
0xff280000      /usr/lib/libc.so.1
0xff350000      /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
0xfec00000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/server/libjvm.so
0xff230000      /usr/lib/libCrun.so.1
0xff200000      /usr/lib/libsocket.so.1
0xfeb00000      /usr/lib/libnsl.so.1
0xfebd0000      /usr/lib/libm.so.1
0xfeae0000      /usr/lib/libsched.so.1
0xff260000      /usr/lib/libw.so.1
0xfeac0000      /usr/lib/libmp.so.2
0xfeaa0000      /usr/lib/librt.so.1
0xfea80000      /usr/lib/libaio.so.1
0xfea50000      /usr/lib/libmd5.so.1
0xfea30000      /usr/platform/SUNW,Ultra-5_10/lib/libmd5_psr.so.1
0xfe9f0000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/native_threads/libhpi.so
0xfe990000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/libverify.so
0xfe950000      /opt/nortel/3rd_party/java/j2sdk_1.4.2_sp1/jre/lib/sparc/libjava.so
0xfe930000      /opt/no

                                    

Comments
EVALUATION

This may be a duplicate of 4846301.  Thanks Jane..

###@###.### 2003-09-24

The following sequence will lead to such a crash:
0) loader1 loads and defines B.
1) Class C which extends B is loaded from resolve_instance_class_or_null()
   by loader 2.
2) A placeholder (C, loader2) is added to the system dictionary.
3) loader 2 loads C and defines C, which in turn resolves B, C's super class,
   in resolve_super_or_fail().
4) loader 2 delegates the loading of B to loader1, which loads B and tries
   to define B. However, loader1 has defined B before, so a "duplicate class
   definition" LinkageError is thrown.
5) The exception will make the placeholder (C, loader2) removed in
   resolve_from_stream(). Because loader2 fails to define C.
6) loader2's loadClass() however, catches the exception and redelegates
   to another loader to finish the loading of C.
7) resolve_instance_class_or_null() is later surprised to find that the
   placeholder (C, loader2) is removed (actually by its own thread!). The code
   since 1.4.2 will crash in this case.

A testcase containing the above sequence is attached.
   
###@###.### 2003-09-26

The fix changed the behavior back to that of 1.4.1, i.e. always update
the system dictionary even if the placeholder is removed.

###@###.### 2003-10-10
                                     
2003-09-26
SUGGESTED FIX

------- systemDictionary.cpp -------
*** /tmp/geta12120      Fri Oct 10 16:59:36 2003
--- /tmp/getb12120      Fri Oct 10 16:59:36 2003
***************
*** 1777,1793 ****
    symbolOop check = find_placeholder(index, name, class_loader);
    if (check != NULL) {
      remove_placeholder(index, name, class_loader);
-     klassOop sd_check = find_class(index, name, class_loader);
-     if (sd_check == NULL) {
-       add_klass(index, name, class_loader, k);
-       notice_modification();
-     } else {
-       // Note that in the current system we do not expect to
-       // encounter this case.  This may change in the future.
-     }
    }
- #ifdef ASSERT
    klassOop sd_check = find_class(index, name, class_loader);
    assert (sd_check != NULL, "should have entry in system dictionary");
    symbolOop ph_check = find_placeholder(index, name, class_loader);
    assert (ph_check == NULL, "should not have a placeholder entry");
--- 1777,1790 ----
    symbolOop check = find_placeholder(index, name, class_loader);
    if (check != NULL) {
      remove_placeholder(index, name, class_loader);
    }
    klassOop sd_check = find_class(index, name, class_loader);
+   if (sd_check == NULL) {
+     add_klass(index, name, class_loader, k);
+     notice_modification();
+   }
+ #ifdef ASSERT
+   sd_check = find_class(index, name, class_loader);
    assert (sd_check != NULL, "should have entry in system dictionary");
    symbolOop ph_check = find_placeholder(index, name, class_loader);
    assert (ph_check == NULL, "should not have a placeholder entry");
                                     
2004-07-08
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
1.4.2_04
tiger-beta

FIXED IN:
1.4.2_04
tiger-beta

INTEGRATED IN:
1.4.2_04
tiger-b25
tiger-beta


                                     
2004-07-08



Hardware and Software, Engineered to Work Together