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

8271869: AArch64: build errors with GCC11 in frame::saved_oop_result #5020

Closed
wants to merge 1 commit into from

Conversation

a74nh
Copy link
Contributor

@a74nh a74nh commented Aug 5, 2021

GCC11 warns that r0 is null. It does not complain if r1 is used instead.

AIUI, it is undefined behaviour in C++ to call member functions without
a valid this pointer. So, technically GCC is correct to warn.


Progress

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

Issue

  • JDK-8271869: AArch64: build errors with GCC11 in frame::saved_oop_result

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5020

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

Using diff file

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

GCC11 warns that r0 is null. It does not complain if r1 is used instead.

AIUI, it is undefined behaviour in C++ to call member functions without
a valid this pointer. So, technically GCC is correct to warn.
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 5, 2021

👋 Welcome back a74nh! 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 Pull request is ready for review label Aug 5, 2021
@openjdk
Copy link

openjdk bot commented Aug 5, 2021

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

  • hotspot

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 hotspot-dev@openjdk.org label Aug 5, 2021
@mlbridge
Copy link

mlbridge bot commented Aug 5, 2021

Webrevs

Copy link
Contributor

@nick-arm nick-arm left a comment

Choose a reason for hiding this comment

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

This looks ok to me as it's the same workaround as JDK-8270083 but @kimbarrett probably ought check it too.

@openjdk
Copy link

openjdk bot commented Aug 9, 2021

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

8271869: AArch64: build errors with GCC11 in frame::saved_oop_result

Reviewed-by: ngasson, aph

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

  • 089e83b: 8266490: Extend the OSContainer API to support the pids controller of cgroups
  • 2384e12: 8270098: ZGC: ZBarrierSetC2::clone_at_expansion fails with "Guard against surprises" assert
  • d53d94b: 8271925: ZGC: Arraycopy stub passes invalid oop to load barrier
  • 3b899ef: 8272168: some hotspot runtime/logging tests don't check exit code
  • abdc107: 8270454: G1: Simplify region index comparison
  • eb6f3fe: 8272169: runtime/logging/LoaderConstraintsTest.java doesn't build test.Empty
  • 9654fd7: 8271892: mark hotspot runtime/PrintStringTableStats/PrintStringTableStatsTest.java test as ignoring external VM flags
  • 843943c: 8263567: gtests don't terminate the VM safely
  • 7fc99cf: 8225488: Examine ExecutableType.getReceiverType behavior when source receiver parameter is absent
  • 4548677: 8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9
  • ... and 32 more: https://git.openjdk.java.net/jdk/compare/18dd4d469d120276d05e74607d780f01056f1a8b...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@nick-arm, @theRealAph) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 9, 2021
@kimbarrett
Copy link

Yuck! But I guess we don't have any other quick solution to supporting this compiler version, so as with JDK-8270083 I'm conditionally approving this as a temporary workaround. I see this bug is already linked to JDK-8270140.

@theRealAph - You mentioned a prototype patch to fix the register definitions (probably addressing JDK-8270140?). How close are you on that? Do you need any help?

@a74nh
Copy link
Contributor Author

a74nh commented Aug 10, 2021

as with JDK-8270083

Ok - that explains why the errors I saw were only in AArch64 files.

@a74nh
Copy link
Contributor Author

a74nh commented Aug 10, 2021

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 10, 2021
@openjdk
Copy link

openjdk bot commented Aug 10, 2021

@a74nh
Your change (at version 7714eaf) is now ready to be sponsored by a Committer.

@nick-arm
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 10, 2021

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

  • 089e83b: 8266490: Extend the OSContainer API to support the pids controller of cgroups
  • 2384e12: 8270098: ZGC: ZBarrierSetC2::clone_at_expansion fails with "Guard against surprises" assert
  • d53d94b: 8271925: ZGC: Arraycopy stub passes invalid oop to load barrier
  • 3b899ef: 8272168: some hotspot runtime/logging tests don't check exit code
  • abdc107: 8270454: G1: Simplify region index comparison
  • eb6f3fe: 8272169: runtime/logging/LoaderConstraintsTest.java doesn't build test.Empty
  • 9654fd7: 8271892: mark hotspot runtime/PrintStringTableStats/PrintStringTableStatsTest.java test as ignoring external VM flags
  • 843943c: 8263567: gtests don't terminate the VM safely
  • 7fc99cf: 8225488: Examine ExecutableType.getReceiverType behavior when source receiver parameter is absent
  • 4548677: 8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9
  • ... and 32 more: https://git.openjdk.java.net/jdk/compare/18dd4d469d120276d05e74607d780f01056f1a8b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 10, 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 sponsor Pull request is ready to be sponsored labels Aug 10, 2021
@openjdk
Copy link

openjdk bot commented Aug 10, 2021

@nick-arm @a74nh Pushed as commit 1f88134.

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

@theRealAph
Copy link
Contributor

On 8/10/21 8:41 AM, Kim Barrett wrote:

Yuck! But I guess we don't have any other quick solution to
supporting this compiler version, so as with JDK-8270083 I'm
conditionally approving this as a temporary workaround. I see this
bug is already linked to JDK-8270140.

@theRealAph - You mentioned a prototype patch to fix the register
definitions (probably addressing JDK-8270140?).

Yes, it fixes that by making Register well-defined behaviour.

How close are you on that? Do you need any help?

The patch works just fine, but there is a smallish performance
degradation. Having said that, the degradation is much less than the
performance gain from 8269122 (The use of "extern const" for Register
definitions generates poor code) so probably no-one would notice, and
we'd get rid of the undefined behaviour. I didn't submit it because I
thought people rather liked the fake-pointer-to-nothing hack and
didn't care about UB. I can dig the patch out if you like.

@mlbridge
Copy link

mlbridge bot commented Sep 1, 2021

Mailing list message from Andrew Haley on hotspot-dev:

On 8/5/21 3:21 PM, Alan Hayward wrote:

GCC11 warns that r0 is null. It does not complain if r1 is used instead.

AIUI, it is undefined behaviour in C++ to call member functions without
a valid this pointer. So, technically GCC is correct to warn.

Correct. I have a prototype patch to fix this, but the same undefined
behaviour recurs several times in the code base, not just Assembler.
I think we should fix it properly, but there is some small size and
space penalty for making the Registers etc valid pointers.

I will approve this now if you really need it, but I wonder if
this should be the spur to actually fixing the bug, not disabling
the warning.

Andrew.

--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

@mlbridge
Copy link

mlbridge bot commented Sep 1, 2021

Mailing list message from Andrew Haley on hotspot-dev:

On 8/10/21 8:41 AM, Kim Barrett wrote:

Yuck! But I guess we don't have any other quick solution to
supporting this compiler version, so as with JDK-8270083 I'm
conditionally approving this as a temporary workaround. I see this
bug is already linked to JDK-8270140.

@theRealAph - You mentioned a prototype patch to fix the register
definitions (probably addressing JDK-8270140?).

Yes, it fixes that by making Register well-defined behaviour.

How close are you on that? Do you need any help?

The patch works just fine, but there is a smallish performance
degradation. Having said that, the degradation is much less than the
performance gain from 8269122 (The use of "extern const" for Register
definitions generates poor code) so probably no-one would notice, and
we'd get rid of the undefined behaviour. I didn't submit it because I
thought people rather liked the fake-pointer-to-nothing hack and
didn't care about UB. I can dig the patch out if you like.

--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

@a74nh a74nh deleted the gcc11_saved_oop_result branch September 2, 2021 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants