> The class `ThreadSnapshot$ThreadLock` is internal ThreadSnapshot class.
> The `ThreadSnapshot` and `ThreadSnapshot$ThreadLock` are created and filled
> by VM. Class `ThreadSnapshot$ThreadLock` is not initialized in this native
> VM code.
>
> The crash originally appeared when jcmd ThreadDump was called for timed-out
> test `compiler/c2/Test6603011.java`. The test is executed with `-Xcomp
> -XX:-Inline` which is required to reproduce the issue.
> In other cases the klass initialized by interpreter or compiler.
>
> This is why this crash was not find by jcmd test that test how jcmd works for
> monitors.
> created but the class is not initialized.
>
> BTW, the `ThreadSnapshot` is initialized
>
> if (snapshot_klass->should_be_initialized()) {
> snapshot_klass->initialize(CHECK_NULL);
> }
>
>
> Note: `-XX:CompileCommand=compileonly,*ThreadSnapshot*::*` in test is to
> reduce execution time only, test fails without it.
>
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK
> Interim AI Policy](https://openjdk.org/legal/ai).
Leonid Mesnik has updated the pull request incrementally with one additional
commit since the last revision:
fixed after feedback
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/32363/files
- new: https://git.openjdk.org/jdk/pull/32363/files/58bf9d8e..74852451
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=32363&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=32363&range=01-02
Stats: 7 lines in 1 file changed: 4 ins; 3 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/32363.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/32363/head:pull/32363
PR: https://git.openjdk.org/jdk/pull/32363