RFR: 8306006: strace001.java fails due to unknown methods on stack

Alan Bateman alanb at openjdk.org
Sun Apr 16 08:10:34 UTC 2023


On Sat, 15 Apr 2023 02:38:11 GMT, David Holmes <dholmes at openjdk.org> wrote:

> I don't think you want to add `afterSleep` as that means the thread woke too soon and we may need to adjust the sleep time. - so we would want that to fail.

If I read the test correctly, "RunningThread" does recursive calls and eventually calls waitForSign where it spins calling Thread.sleep(1). The observer calling java.lang.management.ThreadInfo::getStackTrace could sample the thread in Thread.sleep at any time so I think it may see afterSleep in the stack. I don't know if there is any value doing this, would it loose anything to ignore any frames deeper than Thread.sleep(long)?

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

PR Comment: https://git.openjdk.org/jdk/pull/13476#issuecomment-1510169356


More information about the serviceability-dev mailing list