RFR: 8282379: [LOOM] vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011 sometimes fails [v2]

Chris Plummer cjplummer at openjdk.org
Tue Feb 7 02:20:43 UTC 2023


On Tue, 7 Feb 2023 01:00:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Okay so these tests are incredibly fragile - as you note display() may be a problem in theory, as could any potential class-loading or initialization. 

Yes, the more that is done int the called method the more fragile it becomes. The javadoc is pretty clear about the risks of using  INVOKE_SINGLE_THREADED, and I think most users (such as IntelliJ) will quickly timeout the invoke, do a vm.resume() to unstick it, and then try the invoke again. The common use of JDI invoke by IDEs is to call toString() on local variables that are references to objects, which means even during common usage the invoke has the potential to do just about anything.
 
> But without the sleep you have a busy-wait loop that may cause problems of its own (e.g. it might trigger on-stack-replacement but the compiler thread may require a resource held by one of the suspended threads!). It is impossible to know that something is 100% safe to do in this kind of situation.

That's not possible since the thread will be in interpOnly mode (because invokes can only be done when suspended at an event).

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

PR: https://git.openjdk.org/jdk/pull/12420


More information about the serviceability-dev mailing list