Skip to content

8304164: jdk/classfile/CorpusTest.java still fails after JDK-8303910 #13037

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

asotona
Copy link
Member

@asotona asotona commented Mar 15, 2023

Massive parallel execution of parametrised CorpusTest junit tests revealed race condition in ClassHierarchyImpl.CachedClassHierarchyResolver::getClassInfo.

The race condition may skip calculation of the ClassHierarchyInfo. In this specific case it caused SegmentScope not being identified as an interface and verify error on assignability between declared method return type and actual returned type has been emitted by the test.

Proposed patch fixes the race condition in ClassHierarchyImpl.CachedClassHierarchyResolver::getClassInfo.

Please review.

Thank you,
Adam


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-8304164: jdk/classfile/CorpusTest.java still fails after JDK-8303910

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13037

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 15, 2023

👋 Welcome back asotona! 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 Mar 15, 2023
@openjdk
Copy link

openjdk bot commented Mar 15, 2023

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Mar 15, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 15, 2023

Webrevs

if (res == null && !resolvedCache.containsKey(classDesc)) {
//using NOPE to distinguish between null value and non-existent record in the cache
//this code is on JDK bootstrap critical path, so cannot use lambdas here
var res = resolvedCache.getOrDefault(classDesc, NOPE);
Copy link
Member

Choose a reason for hiding this comment

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

resolvedCache is a Collections.synchronizedMap backed by a HashMap. So the getOrDefault() (internally) synchronizes on the resolvedCache instance itself and thus this operation would be thread safe in context of access to this cache in rest of this code. So what you propose here looks good to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you.

@openjdk
Copy link

openjdk bot commented Mar 17, 2023

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

8304164: jdk/classfile/CorpusTest.java still fails after JDK-8303910

Reviewed-by: jpai

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

  • 6b42275: 7154070: in SwingSet2, switching between LaFs it's easy to lose JTable dividers
  • 8eed7de: 8304146: Refactor VisibleMemberTable (LocalMemberTable)
  • a487a27: 8303150: DCmd framework unnecessarily creates a DCmd instance on registration
  • 2e987d7: 8304360: Test to ensure ConstantDescs fields work
  • 2f23c80: 8304225: Remove javax/script/Test7.java from ProblemList
  • 96889bf: 8191565: Last-ditch Full GC should also move humongous objects
  • f629152: 8304055: G1: Remove OldGCAllocRegion::release
  • b5108b4: 8303749: Serial: Use more strict card table API
  • 7dbab81: 8304161: Add TypeKind.from to derive from TypeDescriptor.OfField
  • d4eb395: 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline)
  • ... and 16 more: https://git.openjdk.org/jdk/compare/714b5f036fc70d8d1d4d3ec8777fe95cffc0fe5b...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 Mar 17, 2023
@asotona
Copy link
Member Author

asotona commented Mar 17, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 17, 2023

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

  • 620564a: 8304130: Add runtime/StackGuardPages/TestStackGuardPagesNative.java to ProblemList.txt
  • 9d518c5: 8299375: [PPC64] GetStackTraceSuspendedStressTest tries to deoptimize frame with invalid fp
  • ebac7ee: 8304063: tools/jpackage/share/AppLauncherEnvTest.java fails when checking LD_LIBRARY_PATH
  • 36995c5: 8304242: CPUInfoTest fails because "serialize" CPU feature is not known
  • 6b42275: 7154070: in SwingSet2, switching between LaFs it's easy to lose JTable dividers
  • 8eed7de: 8304146: Refactor VisibleMemberTable (LocalMemberTable)
  • a487a27: 8303150: DCmd framework unnecessarily creates a DCmd instance on registration
  • 2e987d7: 8304360: Test to ensure ConstantDescs fields work
  • 2f23c80: 8304225: Remove javax/script/Test7.java from ProblemList
  • 96889bf: 8191565: Last-ditch Full GC should also move humongous objects
  • ... and 20 more: https://git.openjdk.org/jdk/compare/714b5f036fc70d8d1d4d3ec8777fe95cffc0fe5b...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 17, 2023

@asotona Pushed as commit b2639e1.

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

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

Successfully merging this pull request may close these issues.

2 participants