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

8291633: Build failures with GCC 11, Alpine 3 due to incompatible casts from nullptr #9705

Closed
wants to merge 4 commits into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Aug 1, 2022

Looks like GCC and musl that ship in new Alpine 3.15 highlight that some casts from NULL and nullptr are risky/illegal.

They fall into three categories:

  • explicitly casting NULL to integral type; we can and should use NULL_WORD in these cases, like the rest of Hotspot does;
  • using NULL in ternary expression when another side is integral type, thus implicitly casting it;
  • reinterpret_cast-ing NULL to pointer type -- this is dangerous and rightfully breaks; we can use static_cast instead.

Additional testing:

  • Linux x86_64 {release, fastdebug, slowdebug} build with Alpine 3.15, GCC 11.2.1
  • Linux x86_64 fastdebug tier1 with GCC 9.3.0

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-8291633: Build failures with GCC 11, Alpine 3 due to incompatible casts from nullptr

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9705

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

Using diff file

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

@shipilev shipilev changed the title 8291633: Build failures with GCC 11, Alpine 3 in due to incompatible casts from nullptr 8291633: Build failures with GCC 11, Alpine 3 due to incompatible casts from nullptr Aug 1, 2022
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 1, 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 Aug 1, 2022
@openjdk
Copy link

openjdk bot commented Aug 1, 2022

@shipilev The following labels will be automatically applied to this pull request:

  • hotspot
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Aug 1, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 1, 2022

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

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

LGTM

@openjdk
Copy link

openjdk bot commented Aug 1, 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:

8291633: Build failures with GCC 11, Alpine 3 due to incompatible casts from nullptr

Reviewed-by: stuefe, mbaesken, jiefu

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

  • 0971d34: Merge
  • 54c093a: 8291524: jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java Value not equal to 2, field='hiddenClassCount', value='0'
  • 1d16c91: 8291512: Snippetize modules API examples
  • 0ae8341: 8290908: misc tests fail: assert(!thread->owns_locks()) failed: must release all locks when leaving VM
  • 5acf2d7: 8291578: Remove JMX related tests from ProblemList-svc-vthreads.txt
  • a6564d4: 8291650: Add delay to ClassUnloadEventTest before exiting to give time for JVM to send all events before VMDeath
  • af76c0c: 8291654: AArch64: assert from JDK-8287393 causes crashes
  • a9db5bb: 8291626: Remove Mutex::contains as it is unused

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 Aug 1, 2022
Copy link
Member

@MBaesken MBaesken 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 to me, thanks for looking into it.

@shipilev
Copy link
Member Author

shipilev commented Aug 3, 2022

Thank you! If there are no other reviews, I'll be integrating this soon.

@DamonFool
Copy link
Member

Thank you! If there are no other reviews, I'll be integrating this soon.

Maybe, we'd better update the copyright year of src/hotspot/cpu/x86/interpreterRT_x86_64.cpp before integration.
Thanks.

@shipilev
Copy link
Member Author

shipilev commented Aug 3, 2022

Maybe, we'd better update the copyright year of src/hotspot/cpu/x86/interpreterRT_x86_64.cpp before integration. Thanks.

Did so in new commit.

Copy link
Member

@DamonFool DamonFool left a comment

Choose a reason for hiding this comment

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

Thanks for the update.
LGTM

@shipilev
Copy link
Member Author

shipilev commented Aug 3, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Aug 3, 2022

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

  • 4d6e6f6: 8291822: ARM32: Build errors with GCC 11 in frame::saved_oop_result
  • e52a340: 8290488: IBM864 character encoding implementation bug
  • af529be: 8285836: sun/net/www/http/KeepAliveCache/KeepAliveProperty.java failed with "RuntimeException: Failed in server"
  • b7d2bde: 8291733: Remove JFR events that expose hashtable
  • 0971d34: Merge
  • 54c093a: 8291524: jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java Value not equal to 2, field='hiddenClassCount', value='0'
  • 1d16c91: 8291512: Snippetize modules API examples
  • 0ae8341: 8290908: misc tests fail: assert(!thread->owns_locks()) failed: must release all locks when leaving VM
  • 5acf2d7: 8291578: Remove JMX related tests from ProblemList-svc-vthreads.txt
  • a6564d4: 8291650: Add delay to ClassUnloadEventTest before exiting to give time for JVM to send all events before VMDeath
  • ... and 2 more: https://git.openjdk.org/jdk/compare/a2cff2634cdaa0fa7ba2a1acd951d6f521f59f6d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 3, 2022

@shipilev Pushed as commit c89556f.

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

@shipilev shipilev deleted the JDK-8291633-alpine3-nullptr branch September 5, 2022 13:46
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 shenandoah shenandoah-dev@openjdk.org
4 participants