RFR: 8301639: JDI and JDWP specs should clarify potential deadlock issues with method invocation
Chris Plummer
cjplummer at openjdk.org
Thu Sep 14 19:08:36 UTC 2023
On Tue, 12 Sep 2023 22:24:18 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
> This PR includes a couple of clarifications of the JDWP and JDI invoke method support. The first is that deadlocks can occur due to a needed "resource" being held. The spec previously just mentioned monitors being held, but this is too specific. The second is to clarify that an invoke on a virtual thread can be more prone to deadlocks than a platform thread may be.
>
> I did a doc build you can look at to view the changes. Links to the relevant sections are below:
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/specs/jdwp/jdwp-protocol.html#JDWP_ClassType_InvokeMethod
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/specs/jdwp/jdwp-protocol.html#JDWP_ClassType_NewInstance
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/specs/jdwp/jdwp-protocol.html#JDWP_InterfaceType_InvokeMethod
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/specs/jdwp/jdwp-protocol.html#JDWP_ObjectReference_InvokeMethod
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/api/jdk.jdi/com/sun/jdi/ClassType.html#invokeMethod(com.sun.jdi.ThreadReference,com.sun.jdi.Method,java.util.List,int)
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/api/jdk.jdi/com/sun/jdi/ClassType.html#newInstance(com.sun.jdi.ThreadReference,com.sun.jdi.Method,java.util.List,int)
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/api/jdk.jdi/com/sun/jdi/InterfaceType.html#invokeMethod(com.sun.jdi.ThreadReference,com.sun.jdi.Method,java.util.List,int)
>
> https://cr.openjdk.org/~cjplummer/8301639/docs.01/api/jdk.jdi/com/sun/jdi/ObjectReference.html#invokeMethod(com.sun.jdi.ThreadReference,com.sun.jdi.Method,java.util.List,int)
I've updated the javadoc to use `@apiNote`. I updated the jdwp spec to not include the extra language regarding virtual threads, but sill include the "resources" vs "monitors" language. Links to the generated docs have been updated.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15695#issuecomment-1719991702
More information about the serviceability-dev
mailing list