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

JDWP-agent sends broken exception event with onthrow option

    XMLWordPrintable

Details

    • b21

    Backports

      Description

        The `onthrow` option of the JDWP-agent causes the agent to only initialize the debugging session after a specificied exception has been thrown. The agent then sends an exception event with the exception that triggered the session start. The sent exception has a null pointer for all its properties:

        ```
        Exception event:
            thread: 0x0
            clazz: 0x0
            method: 0x0
            location: 0
            object: 0x0
            catch_clazz: 0x0
            catch_method: 0x0
            catch_location: 0
        ```

        This in turn causes jdb to throw an internal NullPointerException:

        ```
        Exception in thread "event-handler" java.lang.NullPointerException: Cannot invoke "com.sun.jdi.ObjectReference.referenceType()" because the return value of "com.sun.jdi.event.ExceptionEvent.exception()" is null
                at jdk.jdi/com.sun.tools.example.debug.tty.TTY.exceptionEvent(TTY.java:171)
                at jdk.jdi/com.sun.tools.example.debug.tty.EventHandler.exceptionEvent(EventHandler.java:295)
                at jdk.jdi/com.sun.tools.example.debug.tty.EventHandler.handleEvent(EventHandler.java:133)
                at jdk.jdi/com.sun.tools.example.debug.tty.EventHandler.run(EventHandler.java:78)
                at java.base/java.lang.Thread.run(Thread.java:1583)
        ```

        Attachments

          Issue Links

            Activity

              People

                jbechberger Johannes Bechberger
                jbechberger Johannes Bechberger
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: