[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8306705: com/sun/jdi/PopAndInvokeTest.java fails with NativeMethodException
From:       Chris Plummer <cjplummer () openjdk ! org>
Date:       2023-04-26 17:54:55
Message-ID: SSC65ZKeSn8fbHW5ZjENhKPK5Jkgxuq6xJKe7LTZ40c=.0a14cb35-2913-491b-9a46-8f8ef07acdfe () github ! com
[Download RAW message or body]

On Tue, 25 Apr 2023 21:07:34 GMT, Chris Plummer <cjplummer@openjdk.org> wrote:

> Recently [JDK-8305511](https://bugs.openjdk.org/browse/JDK-8305511) removed the \
> "@ignore 6951287 ", allowing this test to run, which is why this failure mode is \
> now turning up. 
> There is a race condition, leading to the `popFrames()` call being done while a \
> native method is in the set of frames to be popped. This results in a \
> `NativeMethodException` instead of the frames being popped. The debuggee has: 
> 
> public static void waiter() {
> if (waiting) {
> return;
> }
> waiting = true;
> System.out.println(" debuggee: in waiter");
> while (true) {
> }
> }
> 
> 
> And the debugger waits for `waiting == true` (checked via JDI calls) before \
> suspending and doing the `popFrames()`. The problem is the println() after setting \
> `waiting = true`. The debugger side can detect that `waiting == true` before the \
> println() is complete, and the println() involves native code. Once `waiting` is \
> set true, we need to make sure no other method calls are made so we can be sure \
> that only the `waiter()` method is on the stack. 
> Note there is a lot of interesting history to this CR, including \
> [JDK-6417053](https://bugs.openjdk.org/browse/JDK-6417053), which actually \
> reproduced this issue long ago (but got closed as CNR), although it failed with a \
> different error message (even though it was the same issue), and the different \
> error message was itself the result of another bug that was inadvertently fixed \
> when virtual threads support was added to JDI. See the CR for details if you are \
> interested.

This pull request has now been integrated.

Changeset: 38cc0391
Author:    Chris Plummer <cjplummer@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/38cc0391f3f7272167f92a4c2faa9fae21a26ef9
                
Stats:     3 lines in 1 file changed: 2 ins; 1 del; 0 mod

8306705: com/sun/jdi/PopAndInvokeTest.java fails with NativeMethodException

Reviewed-by: lmesnik, amenkov, sspitsyn

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic