Skip to content

8302849: SurfaceManager might expose partially constructed object #12654

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

minborg
Copy link
Contributor

@minborg minborg commented Feb 20, 2023

This PR proposes to add volatile to a variable declaration in order to prevent partially initialized objects to be observed by threads.

SurfaceManager is using a lazily initialized cacheMap that is initialized using a double-checked locking mechanism. Generally, objects initialized using such constructs need to be declared volatile.

See https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java


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-8302849: SurfaceManager might expose partially constructed object

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12654

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 20, 2023

👋 Welcome back pminborg! 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 Feb 20, 2023
@openjdk
Copy link

openjdk bot commented Feb 20, 2023

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

  • client

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 client client-libs-dev@openjdk.org label Feb 20, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 20, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented Feb 20, 2023

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

8302849: SurfaceManager might expose partially constructed object

Reviewed-by: serb

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

  • 9a79722: 8299234: JMX Repository.query performance
  • e47e9ec: 8300658: memory_and_swap_limit() reporting wrong values on systems with swapaccount=0
  • 7cf7e0a: 8302070: Factor null-check into load_klass() calls
  • e731695: 8302882: Newly added test javax/swing/JFileChooser/JFileChooserFontReset.java fails with HeadlessException
  • b5a7426: 8301749: Tracking malloc pooled memory size
  • 6ac5e05: 8302068: Serial: Refactor oop closures used in Young GC
  • 71cf7c4: 8302518: Add missing Op_RoundDoubleMode in VectorNode::vector_operands()
  • 98716e2: 8302709: Remove explicit remembered set verification in G1
  • 303c61f: 8302776: RISC-V: Fix typo CSR_INSTERT to CSR_INSTRET
  • 7c40c8a: 8302312: Make ParGCRareEvent_lock G1 specific
  • ... and 6 more: https://git.openjdk.org/jdk/compare/432cf68c4dd1dcce478fccb85163aa0d824474d7...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.

➡️ 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 Feb 20, 2023
@minborg
Copy link
Contributor Author

minborg commented Feb 22, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Feb 22, 2023

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

  • 30b2ac4: 8302873: ZGC: dump barrier data in C2 Mach nodes
  • 861eea9: 8302858: Polish FlightRecorderMXBeanImpl
  • 60a3581: 8302856: Typo in FlightRecorderMXBeanImpl
  • 3f3a1f5: 8302815: Use new Math.clamp method in core libraries
  • 5e1d1b7: 8302870: More information needed from failures in vmTestbase ThreadUtils.waitThreadState
  • 7f35389: 8302888: containers/docker/TestJcmd.java fails when run as root under podman
  • b6ecca1: 8280113: (dc) DatagramSocket.receive does not always throw when the channel is closed
  • f54e108: 8302831: PPC: compiler/codecache/TestStressCodeBuffers.java fails after JDK-8301819
  • cba817a: 8302838: jabswitch main() should avoid calling exit explicitly
  • 2c52cf0: 8041447: Test javax/swing/dnd/7171812/bug7171812.java fails with java.lang.RuntimeException: Test failed, scroll on drag doesn't work
  • ... and 50 more: https://git.openjdk.org/jdk/compare/432cf68c4dd1dcce478fccb85163aa0d824474d7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 22, 2023

@minborg Pushed as commit 63ef214.

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

@turbanoff
Copy link
Member

Copyright year update seems forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants