Skip to content
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

8264908: Investigate adding BOT range check in G1BlockOffsetTablePart::block_at_or_preceding #4775

Conversation

walulyai
Copy link
Member

@walulyai walulyai commented Jul 14, 2021

Hi all,

Please review this cleanup change to add an assert to G1BlockOffsetTablePart::block_at_or_preceding. Additionally, remove code that attempts to read beyond the _next_offset_index threshold.

Testing: Tier 1-3


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8264908: Investigate adding BOT range check in G1BlockOffsetTablePart::block_at_or_preceding

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4775/head:pull/4775
$ git checkout pull/4775

Update a local copy of the PR:
$ git checkout pull/4775
$ git pull https://git.openjdk.java.net/jdk pull/4775/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4775

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4775.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 14, 2021

👋 Welcome back iwalulya! 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 openjdk bot added the rfr label Jul 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 14, 2021

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

  • hotspot-gc

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-gc label Jul 14, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 14, 2021

Webrevs

@albertnetymk
Copy link
Member

@albertnetymk albertnetymk commented Jul 14, 2021

Re if (addr >= _hr->bottom() && addr < _hr->top()) {, I don't think we ever pass addr outside [bottom, top), so I suggest restore the original code and change this to an assert in another PR.

@walulyai
Copy link
Member Author

@walulyai walulyai commented Jul 14, 2021

Re if (addr >= _hr->bottom() && addr < _hr->top()) {, I don't think we ever pass addr outside [bottom, top), so I suggest restore the original code and change this to an assert in another PR.

Thanks, will do that.

@walulyai walulyai force-pushed the JDK-8264908_G1BlockOffsetTablePart_block_at_or_preceding branch from 96ff795 to 1d71c8c Compare Jul 14, 2021
// "addr" is past the end, start at the last valid index.
index = MIN2(index, _next_offset_index - 1);
// We must make sure that the offset table entry we use is valid.
assert(index < _next_offset_index, "Precondition");
Copy link
Contributor

@tschatzl tschatzl Jul 14, 2021

Choose a reason for hiding this comment

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

I feel a bit uneasy that the caller (block_start) allows more than the callee (values < _hr->end()), but this is probably the change that is supposed to be coming?
Looks good, but I would have preferred the original change or the upcoming change with some asserts included.

Copy link
Member Author

@walulyai walulyai Jul 14, 2021

Choose a reason for hiding this comment

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

I can add the deferred change, instead of splitting it off into a separate PR.

Copy link
Member

@albertnetymk albertnetymk Jul 14, 2021

Choose a reason for hiding this comment

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

the caller (block_start) allows more than the callee (values < _hr->end())

That path should never be taken, so I am not worried about. I suggested putting that in another PR since those assertions are not obvious from the current ticket title. Anyway, this is subjective.

Copy link
Contributor

@tschatzl tschatzl Jul 14, 2021

Choose a reason for hiding this comment

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

@albertnetymk : I know. Still it seems something is missing to me, but that's subjective. Let's just defer it.

// "addr" is past the end, start at the last valid index.
index = MIN2(index, _next_offset_index - 1);
// We must make sure that the offset table entry we use is valid.
assert(index < _next_offset_index, "Precondition");
Copy link
Contributor

@tschatzl tschatzl Jul 14, 2021

Choose a reason for hiding this comment

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

@albertnetymk : I know. Still it seems something is missing to me, but that's subjective. Let's just defer it.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 14, 2021

@walulyai This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8264908: Investigate adding BOT range check in G1BlockOffsetTablePart::block_at_or_preceding

Reviewed-by: ayang, tschatzl

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • 357fe09: 8247351: [aarch64] NullPointerException during stack walking (clhsdb "where -a")

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jul 14, 2021
@walulyai
Copy link
Member Author

@walulyai walulyai commented Jul 15, 2021

Thanks @albertnetymk and @tschatzl for the reviews!

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 2021

Going to push as commit 99d7f9a.
Since your change was applied there have been 21 commits pushed to the master branch:

  • e92e2fd: 8270517: Add Zero support for LoongArch
  • 7a89ffe: 8270014: Add scoped objects for g1 young gc verification and young gc internal timing
  • 793d772: 8270475: Remove unused G1STWDrainQueueClosure
  • 1ebd946: 8270333: -XX:+VerifyStringTableAtExit should not do linear search
  • 04b73bc: 8269656: The test test/langtools/tools/javac/versions/Versions.java has duplicate test cycles
  • 7c23491: 8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858
  • 7d0edb5: Merge
  • 7b4d84c: 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
  • 72db09b: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
  • 3bbd233: 8270075: SplittableRandom extends AbstractSplittableGenerator
  • ... and 11 more: https://git.openjdk.java.net/jdk/compare/589a1d53df0f53c064fda8a2ac491e0a536ea487...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 15, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jul 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 2021

@walulyai Pushed as commit 99d7f9a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants