On Mon, 28 Sep 2020 19:15:35 GMT, Robbin Ehn <r...@openjdk.org> wrote:

>> Robbin, thank you for your answers!
>> There are JVMTI functions that are specified to return error code 
>> JVMTI_ERROR_THREAD_NOT_ALIVE.
>> As an example, see:
>>   
>> https://docs.oracle.com/en/java/javase/15/docs/specs/jvmti.html#GetStackTrace
>> The following functions are impacted by your fix:
>>   GetOwnedMonitorInfo, GetOwnedMonitorStackDepthInfo, 
>> GetCurrentContendedMonitor, GetStackTrace, GetFrameCount,
>>   GetFrameLocation, PopFrame
>> 
>> I wonder, how this error code can be ever returned for these functions now.
>
>> Robbin, thank you for your answers!
>> There are JVMTI functions that are specified to return error code 
>> JVMTI_ERROR_THREAD_NOT_ALIVE.
>> As an example, see:
>> https://docs.oracle.com/en/java/javase/15/docs/specs/jvmti.html#GetStackTrace
>> The following functions are impacted by your fix:
>> GetOwnedMonitorInfo, GetOwnedMonitorStackDepthInfo, 
>> GetCurrentContendedMonitor, GetStackTrace, GetFrameCount,
>> GetFrameLocation, PopFrame
>> I wonder, how this error code can be ever returned for these functions now.
> 
> They should have exactly the same behavior as previously.
> All I did was set JVMTI_ERROR_THREAD_NOT_ALIVE as the default value for those 
> handshakes:
> https://github.com/openjdk/jdk/blob/3a95750e6474214c62b04fccbfe172d077d3915f/src/hotspot/share/prims/jvmtiEnvBase.hpp#L345
> Which simplifies the code.
> So only in the two cases where the guarantee's are we can never return that
> (reset_current_location/enter_interp_only_mode)
> If the guarantee's are wrong, the current code have that bug already, so I'm 
> not adding or fixing that.
> 
> It should be exactly the same and we have test for at least some of the 
> operations which verifies that the agent gets:
> JVMTI_ERROR_THREAD_NOT_ALIVE
> And this passes t1-8 multiple times, so I'm pretty confident that this does 
> not change any return value.

Robbin, you are right - thanks.
The JVMTI_ERROR_THREAD_NOT_ALIVE is the default value.

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

PR: https://git.openjdk.java.net/jdk/pull/151

Reply via email to