On Fri, 2 Oct 2026 09:41:09 GMT, Matthias Baesken <[email protected]> wrote:

>> I would argue that too is an uncessary check, and in fact the caller ends up 
>> asserting that JVMTI_ERROR_NONE is returned, which implies that it should 
>> always be returned. But there is a bug here.  methodReturnType() calls JVMTI 
>> GetMethodName, which can return an error for various reasons, such as out of 
>> memory. If it doesn't return an error, we can trust the method signature 
>> returned, but if it does return an error it should be handled properly but 
>> is not. Generally speaking in the debug agent, something like an out of 
>> memory results in EXIT_ERROR, so someone in the call chain needs to make the 
>> error check and do the EXIT_ERROR. But that doesn't mean methodReturnType() 
>> should be doing any verification on the signature other than with asserts. 
>> So I think consistency here means doing the assert rather than returning an 
>> error.
>
>> methodReturnType
> 
> Are you refering to  methodSignature ?
> https://github.com/openjdk/jdk/blob/46fbea9c4b9b628e43dd8474bde2bd8e984bf857/src/jdk.jdwp.agent/share/native/libjdwp/util.c#L708-L736
> where we call GetMethodName ?  methodReturnType does not call GetMethodName, 
> but calls methodSignature which calls GetMethodName.

Yes.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32929#discussion_r4166837380

Reply via email to