The test incorrectly expects that some system threads must be started in the `early JVMTI_PHASE_START` phase. However, there is a race here and it is possible that the `JVMTI_PHASE_LIVE` phase is reached before any system thread has been started. The fix is to wait for the first `THREAD_START` event at the `VM_INIT` event.
The update includes some other changes and minor refactoring: - the file `libMAAThreadStart.c` has been renamed to `libMAAThreadStart.cpp` - the test library `jvmti_common.hpp` is used where it is possible - static variable `printdump` has been removed - the static block with `loadLibrary` has been removed from the `MAAThreadStart.java` Testing: - ran the modified test locally - TBD: submit mach5 tiers 1-5 ------------- Commit messages: - 8225354: serviceability/jvmti/ModuleAwareAgents/ThreadStart failed with Didn't get ThreadStart events in VM early start phase! Changes: https://git.openjdk.org/jdk/pull/25948/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25948&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8225354 Stats: 331 lines in 4 files changed: 141 ins; 189 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25948.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25948/head:pull/25948 PR: https://git.openjdk.org/jdk/pull/25948