Skip to content

8261857: serviceability/sa/ClhsdbPrintAll.java failed with "Test ERROR java.lang.RuntimeException: 'cannot be cast to' found in stdout" #2624

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

plummercj
Copy link
Contributor

@plummercj plummercj commented Feb 18, 2021

The test is checking for "cannot be cast to" because at one point there was a bug in printall that was causing a ClassCastException. See JDK-8175384. However, there is also a "cannot be cast to" message in the printall output when disassembling since the java source actually has it in a string literal:

3203 302 ldc #214(6) <String " cannot be cast to ResourceBundle"> [fast_aldc]

Which comes from the following in the ResourceBundle.java source:

                    throw new ClassCastException(c.getName()
                            + " cannot be cast to ResourceBundle"); 

So this occurrence of "cannot be cast" is fine. The one we don't want comes from SharedRuntime::generate_class_cast_message() in sharedRuntime.cpp:

"class %s cannot be cast to class %s (%s%s%s)",

So we can avoid this bug by changing the check to be a bit more explicit and check for "cannot be cast to class" instead.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8261857: serviceability/sa/ClhsdbPrintAll.java failed with "Test ERROR java.lang.RuntimeException: 'cannot be cast to' found in stdout"

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2624/head:pull/2624
$ git checkout pull/2624

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 18, 2021

👋 Welcome back cjplummer! 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 18, 2021
@openjdk
Copy link

openjdk bot commented Feb 18, 2021

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

  • serviceability

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 serviceability serviceability-dev@openjdk.org label Feb 18, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 18, 2021

Webrevs

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Choose a reason for hiding this comment

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

This looks good and trivial.

@openjdk
Copy link

openjdk bot commented Feb 20, 2021

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

8261857: serviceability/sa/ClhsdbPrintAll.java failed with "Test ERROR java.lang.RuntimeException: 'cannot be cast to' found in stdout"

Reviewed-by: sspitsyn

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

  • 2b00367: 8261350: Create implementation for NSAccessibilityCheckBox protocol peer
  • 5a25cea: 8261998: Remove unused shared entry support from utilities/hashtable
  • 4755958: 8262041: javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java fails after JDK-8260858
  • b10376b: 8261938: ASN1Formatter.annotate should not return in the finally block
  • 977a21a: 8261225: TieredStopAtLevel should have no effect if TieredCompilation is disabled
  • c53acc2: 8261542: X86 slice and unslice intrinsics for 256-bit byte/short vectors
  • 8b4fd77: 8262042: ProblemList javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java on Windows
  • 7ffa148: 8247918: Clarify Reader.skip behavior for end of stream
  • 8a1c712: 8261728: SimpleDateFormat should link to DateTimeFormatter
  • 851b2e3: 6245663: (spec) File.renameTo(File) changes the file-system object, not the File instance
  • ... and 58 more: https://git.openjdk.java.net/jdk/compare/34ae7aeb64db90dcb4d2f3d4acb16c714a32824f...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, 2021
@plummercj
Copy link
Contributor Author

Thanks Serguei!

@plummercj
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Feb 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 20, 2021
@openjdk
Copy link

openjdk bot commented Feb 20, 2021

@plummercj Since your change was applied there have been 68 commits pushed to the master branch:

  • 2b00367: 8261350: Create implementation for NSAccessibilityCheckBox protocol peer
  • 5a25cea: 8261998: Remove unused shared entry support from utilities/hashtable
  • 4755958: 8262041: javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java fails after JDK-8260858
  • b10376b: 8261938: ASN1Formatter.annotate should not return in the finally block
  • 977a21a: 8261225: TieredStopAtLevel should have no effect if TieredCompilation is disabled
  • c53acc2: 8261542: X86 slice and unslice intrinsics for 256-bit byte/short vectors
  • 8b4fd77: 8262042: ProblemList javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java on Windows
  • 7ffa148: 8247918: Clarify Reader.skip behavior for end of stream
  • 8a1c712: 8261728: SimpleDateFormat should link to DateTimeFormatter
  • 851b2e3: 6245663: (spec) File.renameTo(File) changes the file-system object, not the File instance
  • ... and 58 more: https://git.openjdk.java.net/jdk/compare/34ae7aeb64db90dcb4d2f3d4acb16c714a32824f...master

Your commit was automatically rebased without conflicts.

Pushed as commit c2509ea.

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

@plummercj plummercj deleted the 8261857-printall branch March 12, 2021 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

2 participants