Skip to content

8364973: Add JVMTI stress testing mode #26360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

lmesnik
Copy link
Member

@lmesnik lmesnik commented Jul 17, 2025

The fix added JVMTI stress testing mode.

This mode enables stress agent that could be executed with jtreg test and help to ensure that jvmti functionality doesn't break the other JVM/JDK functionality.

I filed few issues and more are coming. I want to push the agent so it is possible to provide reproduces for problems uncovered by this agent.

The agent has 2 modes now:

  • regular that is compatible with most of tests including other jvmti, jdi and jdb tests
  • debugger, that additionally test some function requiring solo capabilities and not compatible with debugger and some jvmti tests

The tests incompatible wiht agent (IR, CDS) and some individual tests from tier1 are excluded. There are not plans to support stable execution of all tests with agent right now. However it provokes some crashes worth to be used for exploratory testing.
Note, that flagless tests are excluded automatically and not executed in this mode.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8364973: Add JVMTI stress testing mode (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26360/head:pull/26360
$ git checkout pull/26360

Update a local copy of the PR:
$ git checkout pull/26360
$ git pull https://git.openjdk.org/jdk.git pull/26360/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26360

View PR using the GUI difftool:
$ git pr show -t 26360

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26360.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 17, 2025

👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 17, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jul 17, 2025

@lmesnik The following label will be automatically applied to this pull request:

  • build

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the build build-dev@openjdk.org label Jul 17, 2025
@lmesnik lmesnik changed the title first version of jvmti stress agent 8364973: Add JVMTI stress testing mode Aug 7, 2025
@lmesnik lmesnik marked this pull request as ready for review August 7, 2025 05:49
@lmesnik
Copy link
Member Author

lmesnik commented Aug 7, 2025

/cc serviceability

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Aug 7, 2025
@openjdk
Copy link

openjdk bot commented Aug 7, 2025

@lmesnik
The serviceability label was successfully added.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 7, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 7, 2025

Webrevs

Comment on lines 63 to 73
# Setup _NT_SYMBOL_PATH on Windows, which points to our pdb files.
ifeq ($(call isTargetOs, windows), true)
ifndef _NT_SYMBOL_PATH
SYMBOL_PATH := $(call PathList, $(sort $(patsubst %/, %, $(dir $(wildcard \
$(addprefix $(SYMBOLS_IMAGE_DIR)/bin/, *.pdb */*.pdb))))))
export _NT_SYMBOL_PATH := $(subst \\,\, $(call FixPath, \
$(subst $(DQUOTE),, $(SYMBOL_PATH))))
$(call LogDebug, Setting _NT_SYMBOL_PATH to $(_NT_SYMBOL_PATH))
endif
endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

Comment on lines 870 to 874
AGENT := $${LIBRARY_PREFIX}JvmtiStressAgent${SHARED_LIBRARY_SUFFIX}=$${JTREG_JVMTI_STRESS_AGENT}
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:${TEST_IMAGE_DIR}/hotspot/jtreg/native/$${AGENT}'
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add the definitions of LIBRARY_PREFIX and SHARED_LIBRARY_SUFFIX for this to work in a remote testing situation.

I asked you to not use {} but () when referencing variables in makefiles.

There is no continuation indentation here, please adjust.

@@ -876,6 +877,15 @@ define SetupRunJtregTestBody
))
endif

ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:${TEST_IMAGE_DIR}/hotspot/jtreg/native/$${AGENT}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:${TEST_IMAGE_DIR}/hotspot/jtreg/native/$${AGENT}'
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:$(TEST_IMAGE_DIR)/hotspot/jtreg/native/$$(AGENT)'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this line looks quite long. Can you check that it does not pass 80 characters? (Can't tell on github reviews...)

Comment on lines +884 to +885
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
))
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
))

Also, the comment on line length applies here.

*
* Test supports 2 modes:
* - standard, where the agent doesn't require debugging capabilities
* - debug, where the agent additionally test debug-related functionality
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - debug, where the agent additionally test debug-related functionality
* - debug, where the agent additionally test debug-related functionality

* - standard, where the agent doesn't require debugging capabilities
* - debug, where the agent additionally test debug-related functionality
* The debug mode is incompatible with debugger tests and debug jvmti tests.
* The standard mode should be compatible with all tests except probelmlisted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The standard mode should be compatible with all tests except probelmlisted.
* The standard mode should be compatible with all tests except problemlisted.

@@ -876,6 +877,15 @@ define SetupRunJtregTestBody
))
endif

ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the usage scenario here. Are you supposed to run this like make test JTREG=JVMTI_STRESS_AGENT=true? If so, this will result in -javaoption:'-agentpath:<test-image>/hotspot/jtreg/native/libJvmtiStressAgent.so=true being sent to jtreg, and that looks sus.

Or how should this be used?

In fact, this option should be described in testing.md.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a jtreg agent options, I use it like
JTREG_JVMTI_STRESS_AGENT=debugger=false
or
JTREG_JVMTI_STRESS_AGENT=debugger=true,verbose
Any of options enable jvmti agent and parsed by it.
I don't want to add 2 options, for hits. The JTREG_JVMTI_STRESS_AGENT=false doesn't make any sense.

The options are defined by stress agent while makefile just propagate them to the agent.

Copy link
Member Author

@lmesnik lmesnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you feedback, I explained the usage of
JTREG_JVMTI_STRESS_AGENT
and applied your changes.

@@ -876,6 +877,15 @@ define SetupRunJtregTestBody
))
endif

ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a jtreg agent options, I use it like
JTREG_JVMTI_STRESS_AGENT=debugger=false
or
JTREG_JVMTI_STRESS_AGENT=debugger=true,verbose
Any of options enable jvmti agent and parsed by it.
I don't want to add 2 options, for hits. The JTREG_JVMTI_STRESS_AGENT=false doesn't make any sense.

The options are defined by stress agent while makefile just propagate them to the agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org rfr Pull request is ready for review serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants