On Mon, 18 Sep 2023 23:00:09 GMT, Mandy Chung <mch...@openjdk.org> wrote:
> `JVM_MoreStackWalk` has a bug that always assumes that the Java frame > stream is currently at the frame decoded in the last patch and so always > advances to the next frame before filling in the new batch of stack frame. > However `JVM_MoreStackWalk` may return 0. The library will set > the continuation to its parent. It then call `JVM_MoreStackWalk` to continue > the stack walking but the last decoded frame has already been advanced. > The Java frame stream is already at the top frame of the parent continuation. > . > The current implementation skips "Continuation::yield0" mistakenly. This > only happens with `-XX:+ShowHiddenFrames` or > `StackWalker.Option.SHOW_HIDDEN_FRAMES`. > > The fix is to pass the number of frames decoded in the last batch to > `JVM_MoreStackWalk` > so that the VM will determine if the current frame should be skipped or not. > > `test/jdk/jdk/internal/vm/Continuation/Scoped.java` test now correctly checks > the expected result where "yield0" exists between "enter" and "run" frames. This pull request has now been integrated. Changeset: c72f0046 Author: Mandy Chung <mch...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/c72f00463fcb1c4a94126932abbc82a2582c10c2 Stats: 210 lines in 7 files changed: 47 ins; 57 del; 106 mod 8316456: StackWalker may skip Continuation::yield0 frame mistakenly Reviewed-by: rpressler, pchilanomate ------------- PR: https://git.openjdk.org/jdk/pull/15804