VirtualThread::tryGetStackTrace needs to handle TIMED_PINNED. If Thread::getStackTrace is called on a virtual Thread goes quickly from unmounted to a timed-park-while-pinned when getStackTrace will fail with:
java.lang.InternalError
at java.base/java.lang.VirtualThread.tryGetStackTrace(VirtualThread.java:995)
at java.base/java.lang.VirtualThread.asyncGetStackTrace(VirtualThread.java:965)
at java.base/java.lang.Thread.getStackTrace(Thread.java:2376)
at GetStackTraceALotWhenPinned.main(GetStackTraceALotWhenPinned.java:72)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
at java.base/java.lang.Thread.run(Thread.java:1570)
This is a regression since JDK-8312498, needs a stress test to provoke this scenario.