Skip to content

8273359: CI: ciInstanceKlass::get_canonical_holder() doesn't respect instance size #5395

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

Closed
wants to merge 1 commit into from

Conversation

iwanowww
Copy link
Contributor

@iwanowww iwanowww commented Sep 7, 2021

Compile::flatten_alias_type() relies on ciInstanceKlass::get_canonical_holder() to canonicalise holder class.
When a declared field is not found for a fixed offset (it can happen for unsafe accesses), the next thing ciInstanceKlass::get_canonical_holder() does it ascends class hierarchy looking for a most specific class without instance fields declared. But it completely ignores the instance size, so it can report a class as canonical while its size is smaller than the offset. It makes the address looks out-of-bounds which breaks idempotence property of address type flattening, because out-of-bounds field address types are flattened to TypeOopPtr::BOTTOM.

Proposed fix stops the ascend when superclass size shrinks below offset.

Testing: hs-tier1 - hs-tier4


Progress

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

Issue

  • JDK-8273359: CI: ciInstanceKlass::get_canonical_holder() doesn't respect instance size

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5395

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 7, 2021

👋 Welcome back vlivanov! 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 Sep 7, 2021

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

  • hotspot-compiler

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-compiler hotspot-compiler-dev@openjdk.org label Sep 7, 2021
@iwanowww iwanowww marked this pull request as ready for review September 7, 2021 17:53
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 7, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 7, 2021

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Sep 7, 2021

@iwanowww 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:

8273359: CI: ciInstanceKlass::get_canonical_holder() doesn't respect instance size

Reviewed-by: kvn

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 5 new commits pushed to the master branch:

  • 270a9d9: 8273043: [TEST_BUG] Automate NimbusJTreeSelTextColor.java
  • df05b4d: 8271923: [macos] the text color on the selected disabled tabbed pane button remains white making text unreadable
  • 2abf3b3: 8271340: Crash PhaseIdealLoop::clone_outer_loop
  • 99fb12c: 8271341: Opcode() != Op_If && Opcode() != Op_RangeCheck) || outcnt() == 2 assert failure with Test7179138_1.java
  • 041ae20: 8268558: [TESTBUG] Case 2 in TestP11KeyFactoryGetRSAKeySpec is skipped

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 Pull request is ready to be integrated label Sep 7, 2021
@iwanowww
Copy link
Contributor Author

iwanowww commented Sep 8, 2021

Thanks for the review, Vladimir.

/integrate

@openjdk
Copy link

openjdk bot commented Sep 8, 2021

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

  • d7efd0e: 8273450: Fix the copyright header of SVML files
  • e5f298a: 8273329: Remove redundant null check from String.getBytes(String charsetName)
  • cb112af: 8269373: some tests in jdk/tools/launcher/ fails on localized Windows platform
  • 7e662e7: 8272413: Incorrect num of element count calculation for vector cast
  • f2f8136: 8265443: IGV: disambiguate groups by emiting additional properties
  • 59c9f75: 8273375: Remove redundant 'new String' calls after concatenation in java.desktop
  • faa942c: 8273000: Remove WeakReference-based class initialisation barrier implementation
  • 21012f2: 8078641: MethodHandle.asTypeCache can retain classes from unloading
  • 1855574: 8273038: ChannelInputStream.transferTo() uses FileChannel.transferTo(FileChannel)
  • 6750c34: 8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS
  • ... and 14 more: https://git.openjdk.java.net/jdk/compare/377b186724473475480b834d99c38b8161bf6917...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 8, 2021
@openjdk
Copy link

openjdk bot commented Sep 8, 2021

@iwanowww Pushed as commit f7e9f56.

💡 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-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants