The following crash can be easily reproduced with Shenandoah and ZGC.
make CONF=linux-x86_64-server-fastdebug TEST_VM_OPTS="-XX:+UseShenandoahGC" run-test TEST=java/foreign/stackwalk/TestAsyncStackWalk.java
or
make CONF=linux-x86_64-server-fastdebug TEST_VM_OPTS="-XX:+UseZGC" run-test TEST=java/foreign/stackwalk/TestAsyncStackWalk.java
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/thread.cpp:1968
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/zgu/ws/jdk17/src/hotspot/share/runtime/thread.cpp:1968), pid=1704229, tid=1704245
# assert((!has_last_Java_frame() && java_call_counter() == 0) || (has_last_Java_frame() && java_call_counter() > 0)) failed: wrong java_sp info!
#
# JRE version: OpenJDK Runtime Environment (17.0) (fastdebug build 17-internal+0-adhoc.zgu.jdk17)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 17-internal+0-adhoc.zgu.jdk17, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x1a6948c] JavaThread::oops_do_no_frames(OopClosure*, CodeBlobClosure*)+0x1bc
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#