Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5096167

null class name crashes VM if ClassFileLoadHook is enabled

    Details

    • Subcomponent:
    • Resolved In Build:
      01
    • CPU:
      generic, x86
    • OS:
      generic, linux

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rfield Robert Field
                  Reporter:
                  rfield Robert Field
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: