jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8342090: Infer::IncorporationBinaryOp::equals can produce side-effects

Open vicente-romero-oracle opened this issue 1 year ago • 12 comments
trafficstars

Type inference uses a cache to store incorporation operations already done. This way we can avoid redoing operations that once done won't produce any change. This can reduce the compilation time when the number of inference variables involved is not trivial. The elements in the cache are implemented with class com.sun.tools.javac.comp.Infer::IncorporationBinaryOp the problem here is that the equals method of this class can produce side effects, implying that after a comparison the compared objects can mutate. This patch is fixing this issue,

TIA


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Warning

 ⚠️ Found leading lowercase letter in issue title for 8288590: javac failure: incompatible types: cannot infer type arguments due to Object.hashCode collision

Issues

  • JDK-8342090: Infer::IncorporationBinaryOp::equals can produce side-effects (Bug - P4)
  • JDK-8288590: javac failure: incompatible types: cannot infer type arguments due to Object.hashCode collision (Bug - P3)

Contributors

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21651

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

Using diff file

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

Webrev

Link to Webrev Comment

vicente-romero-oracle avatar Oct 22 '24 23:10 vicente-romero-oracle

/add contributor mcimadamore

vicente-romero-oracle avatar Oct 22 '24 23:10 vicente-romero-oracle

:wave: Welcome back vromero! 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.

bridgekeeper[bot] avatar Oct 22 '24 23:10 bridgekeeper[bot]

@vicente-romero-oracle 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:

8342090: Infer::IncorporationBinaryOp::equals can produce side-effects
8288590: javac failure: incompatible types: cannot infer type arguments due to Object.hashCode collision

Co-authored-by: Maurizio Cimadamore <[email protected]>
Reviewed-by: mcimadamore

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

  • 3c14c2babbdfb46a77636ed80e083ef2f8be2b45: 8341566: Add Reader.of(CharSequence)
  • b0ac633b2d0076d64b463b2a6ce19abf6b12c50f: 8342075: HttpClient: improve HTTP/2 flow control checks
  • 85774b713edf8782f162ac25b61ce99a77e116f4: 8342882: RISC-V: Unify handling of jumps to runtime
  • 2c31c8eeb42188ad6fd15eca50db4342cd791fb2: 8339730: Windows regression after removing ObjectMonitor Responsible
  • f0b130e54f33d3190640ce33c991e35f27e9f812: 8339296: Record deconstruction pattern in switch fails to compile
  • e96b4cf0a81914c6a615bb4f62ea3f139a4737f3: 8342387: C2 SuperWord: refactor and improve compiler/loopopts/superword/TestDependencyOffsets.java
  • f7a61fce949ea2d15ec09d295c643d0c2eabea1e: 8342931: ProblemList failing tests from JDK-8335912
  • 25c2f48d458bfd92423c311a887679ad3e1e4041: 8338544: Dedicated Array class descriptor implementation
  • 158b93d19a518d2b9d3d185e2d4c4dbff9c82aab: 8335912: Add an operation mode to the jar command when extracting to not overwriting existing files
  • 28d23ada6dde007ed60b8538cc159afc62d76db3: 8340177: Malformed system classes loaded by bootloader crash the JVM in product builds
  • ... and 17 more: https://git.openjdk.org/jdk/compare/d6eddcdaf92f2352266ba519608879141997cd63...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[bot] avatar Oct 22 '24 23:10 openjdk[bot]

@vicente-romero-oracle Unknown command add - for a list of valid commands use /help.

openjdk[bot] avatar Oct 22 '24 23:10 openjdk[bot]

@vicente-romero-oracle The following label will be automatically applied to this pull request:

  • 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[bot] avatar Oct 22 '24 23:10 openjdk[bot]

/contributor add mcimadamore

vicente-romero-oracle avatar Oct 22 '24 23:10 vicente-romero-oracle

⚠️ @vicente-romero-oracle This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

openjdk[bot] avatar Oct 22 '24 23:10 openjdk[bot]

@vicente-romero-oracle Contributor Maurizio Cimadamore <[email protected]> successfully added.

openjdk[bot] avatar Oct 22 '24 23:10 openjdk[bot]

tests still running

vicente-romero-oracle avatar Oct 22 '24 23:10 vicente-romero-oracle

/solves 8288590

vicente-romero-oracle avatar Oct 22 '24 23:10 vicente-romero-oracle

@vicente-romero-oracle Adding additional issue to solves list: 8288590: javac failure: incompatible types: cannot infer type arguments due to Object.hashCode collision.

openjdk[bot] avatar Oct 22 '24 23:10 openjdk[bot]

/integrate

vicente-romero-oracle avatar Oct 24 '24 17:10 vicente-romero-oracle

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

  • 7af46a6b424cadfe298958d774da0f21db58ecd3: 8340554: Improve MessageFormat readObject checks
  • 7d5eefa50673d6f7c5bd916f63271cf7898d6dee: 8342862: Gtest added by 8339507 appears to be causing 8GB build machines to hang
  • d8c3b0f834c603fe115ef4ca442727948b7a834e: 8342768: GTest AssemblerX86.validate_vm failed: assert(VM_Version::supports_bmi1()) failed: tzcnt instruction not supported
  • 3c14c2babbdfb46a77636ed80e083ef2f8be2b45: 8341566: Add Reader.of(CharSequence)
  • b0ac633b2d0076d64b463b2a6ce19abf6b12c50f: 8342075: HttpClient: improve HTTP/2 flow control checks
  • 85774b713edf8782f162ac25b61ce99a77e116f4: 8342882: RISC-V: Unify handling of jumps to runtime
  • 2c31c8eeb42188ad6fd15eca50db4342cd791fb2: 8339730: Windows regression after removing ObjectMonitor Responsible
  • f0b130e54f33d3190640ce33c991e35f27e9f812: 8339296: Record deconstruction pattern in switch fails to compile
  • e96b4cf0a81914c6a615bb4f62ea3f139a4737f3: 8342387: C2 SuperWord: refactor and improve compiler/loopopts/superword/TestDependencyOffsets.java
  • f7a61fce949ea2d15ec09d295c643d0c2eabea1e: 8342931: ProblemList failing tests from JDK-8335912
  • ... and 20 more: https://git.openjdk.org/jdk/compare/d6eddcdaf92f2352266ba519608879141997cd63...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Oct 24 '24 17:10 openjdk[bot]

@vicente-romero-oracle Pushed as commit d1540e2a49c7a41eb771fc9896c367187d070dec.

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

openjdk[bot] avatar Oct 24 '24 17:10 openjdk[bot]

Thank you for looking into this!

gilles-duboscq avatar Oct 24 '24 18:10 gilles-duboscq