Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/ jdk19 Public archive

8288754: GCC 12 fails to build zReferenceProcessor.cpp #47

Closed
wants to merge 2 commits into from
Closed

8288754: GCC 12 fails to build zReferenceProcessor.cpp #47

wants to merge 2 commits into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Jun 20, 2022

When compiling with GCC 12.1.1 (current in Fedora rawhide), the following warning-as-error is produced and breaks the build by default:

/home/test/shipilev-jdk/src/hotspot/share/gc/z/zReferenceProcessor.cpp: In member function 'oopDesc* ZReferenceProcessor::drop(oop, ReferenceType)':
/home/test/shipilev-jdk/src/hotspot/share/gc/z/zReferenceProcessor.cpp:270:22: error: '%s' directive argument is null [-Werror=format-overflow=]
  270 | log_trace(gc, ref)("Dropped Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The problem is over-zealous compiler seeing NULL from ShouldNotReachHere() block, and complaining about it. In this particular case, we can dodge this by returning a more reasonable constant on failure path.

(This thing should be more reasonably handled when ShouldNotReachHere() is somehow nonreturn-ed, but Hotspot style doc is still undecided on this).

Additional testing:

  • Linux x86_64 fastdebug build with GCC 12.1.1

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-8288754: GCC 12 fails to build zReferenceProcessor.cpp

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 47

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/47.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 20, 2022

👋 Welcome back shade! 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 Jun 20, 2022
@openjdk
Copy link

openjdk bot commented Jun 20, 2022

@shipilev 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 hotspot-gc-dev@openjdk.org label Jun 20, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 20, 2022

Webrevs

Copy link

@kimbarrett kimbarrett 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.

(This thing should be more reasonably handled when ShouldNotReachHere() is
somehow nonreturn-ed, but Hotspot style doc is still undecided on this).

The problem with using [[noreturn]] for assert/guarantee/ShouldNotReachHere
&etc is that they aren't currently noreturn, due to Debugging and
(in non-product builds) SuppressErrorAt. I've sometimes wondered if anyone
actually uses SuppressErrorAt. But I haven't pursued the question because of
Debugging, which seems to be involved in dealing with error handler
reentrancy or recursion or the like (I don't recall details).

@openjdk
Copy link

openjdk bot commented Jun 20, 2022

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

8288754: GCC 12 fails to build zReferenceProcessor.cpp

Reviewed-by: kbarrett, ayang, stefank, 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 4 new commits pushed to the master branch:

  • e26d3b3: 8288497: add support for JavaThread::is_oop_safe()
  • c74a923: 8288531: Empty spans in mobile navigation markup
  • af05139: 8288467: remove memory_operand assert for spilled instructions
  • b9c3966: 8288671: Problematic fix for font boosting

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 Jun 20, 2022
@stefank
Copy link
Member

stefank commented Jun 21, 2022

Looks good.

(This thing should be more reasonably handled when ShouldNotReachHere() is
somehow nonreturn-ed, but Hotspot style doc is still undecided on this).

The problem with using [[noreturn]] for assert/guarantee/ShouldNotReachHere &etc is that they aren't currently noreturn, due to Debugging and (in non-product builds) SuppressErrorAt. I've sometimes wondered if anyone actually uses SuppressErrorAt. But I haven't pursued the question because of Debugging, which seems to be involved in dealing with error handler reentrancy or recursion or the like (I don't recall details).

Also, see the discussion in https://bugs.openjdk.org/browse/JDK-8065585

@shipilev
Copy link
Member Author

@stefank, do you agree with this patch?

@stefank
Copy link
Member

stefank commented Jun 21, 2022

Yes, that seems to be a good fix. I would have preferred to say "Unknown" instead of "ERROR", but that could be changed later if you want to push.

@shipilev
Copy link
Member Author

Oh, we can change that to Unknown, no problem there.

@shipilev
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jun 21, 2022

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

  • 198cec9: 8286103: VThreadMonitorTest fails "assert(!current->cont_fastpath() || (current->cont_fastpath_thread_state() && !interpreted_native_or_deoptimized_on_stack(current))) failed"
  • 97200a7: 8278053: serviceability/jvmti/vthread/ContStackDepthTest/ContStackDepthTest.java failing in loom repo with Xcomp
  • 31d981e: 8288532: additional review changes for JDK-8286830
  • a144988: 8288139: JavaThread touches oop after GC barrier is detached
  • e26d3b3: 8288497: add support for JavaThread::is_oop_safe()
  • c74a923: 8288531: Empty spans in mobile navigation markup
  • af05139: 8288467: remove memory_operand assert for spilled instructions
  • b9c3966: 8288671: Problematic fix for font boosting

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 21, 2022
@openjdk openjdk bot closed this Jun 21, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 21, 2022
@openjdk
Copy link

openjdk bot commented Jun 21, 2022

@shipilev Pushed as commit 834d92d.

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

@shipilev shipilev deleted the JDK-8288754-gcc12-zgc branch June 22, 2022 17:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants