-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
hopper
-
generic
-
generic
-
Verified
While this has yet to been seen in practice, I think there is a bug in JDKClassLoader due to lack of synchronization and the double checked locking failure of the memory model.
The latestUserDefinedClassLoaderMethod is static, but not set by a static initializer. It is set by first checking for null, and then doing a privileged method to set and turn on its accessibility flag. This code is unsynchronized.
Solutions:
1. Always synchronize before the check/set
2. Move the reflection method lookup/set to a static initializer if possible
This would probably show up as one thread in a multi-threaded system not finding a stub class on the first attempt.
********************************************************************************
###@###.### 2002-04-05
Fix verified OK by code inspection
- with build: j2sdk-1_4_1-beta-bin-b07-solaris-sparc-02_apr_2002
- verified files: com/sun/corba/se/internal/util/JDKClassLoader.java
********************************************************************************
The latestUserDefinedClassLoaderMethod is static, but not set by a static initializer. It is set by first checking for null, and then doing a privileged method to set and turn on its accessibility flag. This code is unsynchronized.
Solutions:
1. Always synchronize before the check/set
2. Move the reflection method lookup/set to a static initializer if possible
This would probably show up as one thread in a multi-threaded system not finding a stub class on the first attempt.
********************************************************************************
###@###.### 2002-04-05
Fix verified OK by code inspection
- with build: j2sdk-1_4_1-beta-bin-b07-solaris-sparc-02_apr_2002
- verified files: com/sun/corba/se/internal/util/JDKClassLoader.java
********************************************************************************