On Mon, 24 Aug 2026 13:16:16 GMT, Coleen Phillimore <[email protected]> wrote:
> I can't find what calls checkStackTrace, and is there an old one that this
> method should replace?
For the share/thread framework it’s MonitoringThread.checkThreadInfo, it
verifies the stack trace there. the ThreadController hunk is the separate
strace001 framework, that one has its own checkStackTrace in BaseThread.
> test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/thread/SleepingThread.java
> line 110:
>
>> 108: log.info("No java.lang.Thread.sleep frame in stack
>> trace for: " + this);
>> 109: return false;
>> 110: }
>
> I don't know why you had to add this. Doesn't checkStackTraceElement with
> the limited expectedMethods only check for java.lang.Thread.
> I feel like this test infrastructure is overly complicated and should be
> reduced at every opportunity.
The base check tests every frame against the list, so with just
java.lang.Thread it fails on current jdks, sleep puts ThreadSleepEvent and
TimeUnit.toNanos frames above the entry frame and those aren’t
java.lang.Thread. that’s why the old list was up to twelve entries covering
sleep internals. the override anchors at the Thread.sleep entry frame and only
checks the stable frames below it, the part above keeps changing between
releases. it also let the list shrink from twelve entries to two.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/31357#issuecomment-5402648095
PR Review Comment: https://git.openjdk.org/jdk/pull/31357#discussion_r3848146407