-
Bug
-
Resolution: Fixed
-
P2
-
5.0
-
01
-
generic, x86
-
generic, linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2121778 | 6 | Robert Field | P3 | Resolved | Fixed | b16 |
java.lang.ClassLoader.defineClass allows a null class name.
If the class name is null, a NULL handle is used in the implementation of the ClassFileLoadHook. This NULL causes the VM to crash.
There is no work-around in the agent -- the crash occurs before the event handler is called.
Since both java.lang.instrument and the hprof demo tool use the ClassFileLoadHook they are both impacted by this.
A known real-world occurrance of this is the xalan XML parser which generates classes on the fly and loads them with a null name.
The fix is trivial, simply the addition of a NULL check -- see suggested fix.
If the class name is null, a NULL handle is used in the implementation of the ClassFileLoadHook. This NULL causes the VM to crash.
There is no work-around in the agent -- the crash occurs before the event handler is called.
Since both java.lang.instrument and the hprof demo tool use the ClassFileLoadHook they are both impacted by this.
A known real-world occurrance of this is the xalan XML parser which generates classes on the fly and loads them with a null name.
The fix is trivial, simply the addition of a NULL check -- see suggested fix.
- backported by
-
JDK-2121778 null class name crashes VM if ClassFileLoadHook is enabled
- Resolved
- duplicates
-
JDK-6201090 JVM crashes with aspectwerkz AOP framework
- Closed
- relates to
-
JDK-5097131 ClassFileLoadHook can be called with classname==NULL, hprof & demos could SEGV
- Resolved