Skip to content

8358696: Assert with extreme values for -XX:BciProfileWidth #26139

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sarannat
Copy link
Contributor

@sarannat sarannat commented Jul 4, 2025

Issue
Extreme values for BciProfileWidth flag such as java -XX:BciProfileWidth=-1 -version and java -XX:BciProfileWidth=100000 -version results in assert failure assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x0000772b63a7a3a0 <= 0x0000772b63b75159 <= 0x0000772b63b75158

Analysis
The flag BciProfileWidth is used to specify the number of return BCI's to be recorded in the ret profile. On debugging the issue, I found that increasing the size of the interpreter using the InterpreterCodeSize in src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp file prevented the above mentioned assert from failing for large values of BciProfileWidth. Additionally, a value below zero for BciProfileWidth implies that no return BCI's are to be recorded in the ret profile. This makes it equivalent to specifying the value zero.

Proposal
Considering the fact that larger BciProfileWidth results in slower profiling, I have proposed a range to restrict the value for BciProfileWidth that works for the current InterpreterCodeSize. The value ofInterpreterCodeSize is platform dependent. Hence, the upper bound of the range results from considering the lowest InterpreterCodeSize that does not result in a failure. However, I have only tested this on a x86 machine.


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-8358696: Assert with extreme values for -XX:BciProfileWidth (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26139

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 4, 2025

👋 Welcome back snatarajan! 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 4, 2025

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

@openjdk openjdk bot changed the title JDK-8358696: Assert with extreme values for -XX:BciProfileWidth 8358696: Assert with extreme values for -XX:BciProfileWidth Jul 4, 2025
@openjdk
Copy link

openjdk bot commented Jul 4, 2025

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

  • hotspot-runtime

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 hotspot-runtime hotspot-runtime-dev@openjdk.org label Jul 4, 2025
@sarannat
Copy link
Contributor Author

sarannat commented Jul 4, 2025

/cc hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jul 4, 2025
@openjdk
Copy link

openjdk bot commented Jul 4, 2025

@sarannat
The hotspot-compiler label was successfully added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

1 participant