RFR: 8376568: Change Thread::getStackTrace to use handshake op for all cases [v2]

David Holmes dholmes at openjdk.org
Fri Jan 30 04:42:45 UTC 2026


On Thu, 29 Jan 2026 17:53:26 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> What would force it to be non-null? (Related: under what conditions will `th` be null and what does that imply about the value of `_thread_h()`?)
>
> A null `java_thread` is only possible for the unmounted vthread case. The oop should always be a valid `java.lang.Thread` though. Maybe `thread_oop` should be initialized to `nullptr` and the assert at line 1914 be just `assert(thread_oop != nullptr, "Missing Thread oop");`?

Okay so `!is_virtual => java_thread != nullptr`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29461#discussion_r2744574434


More information about the core-libs-dev mailing list