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

8264337: VM crashed when -XX:+VerifySharedSpaces #3244

Closed

Conversation

@kelthuzadx
Copy link
Member

@kelthuzadx kelthuzadx commented Mar 29, 2021

java -XX:+VerifySharedSpaces -version reports an internal error that would crash VM:

[0.113s][error][cds] relocation bitmap CRC error
[0.114s][error][cds] relocation bitmap CRC error
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/javaClasses.inline.hpp:215
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/qingfeng.yy/openjdk16_so_warning/jdk/src/hotspot/share/classfile/javaClasses.inline.hpp:215), pid=75241, tid=75242
# assert(java_lang_Class::is_instance(java_class)) failed: must be a Class object
#
# JRE version: (17.0) (slowdebug build )
# Java VM: OpenJDK 64-Bit Server VM (slowdebug 17-internal+0-adhoc.qingfengyy.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x697d19] java_lang_Class::as_Klass(oopDesc*)+0x29
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/qingfeng.yy/openjdk16_so_warning/jdk/build/linux-x86_64-server-slowdebug/images/jdk/bin/hs_err_pid75241.log
#
#

The gut of this problem is that the calculation of crc32 for the CDS archive is inconsistent between dumptime and runtime, this will cause subsequent steps to deviate from the desired path one after another, eventually leading to an internal error that crashes the VM.

All tests under hotspot/jtreg/runtime/cds are passed(excepts those problem-listed) with slowdebug mode.


Progress

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

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3244/head:pull/3244
$ git checkout pull/3244

Update a local copy of the PR:
$ git checkout pull/3244
$ git pull https://git.openjdk.java.net/jdk pull/3244/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3244

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3244.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 29, 2021

👋 Welcome back yyang! 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 label Mar 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 29, 2021

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

  • hotspot-runtime

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.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 29, 2021

Webrevs

@yminqi
yminqi approved these changes Mar 29, 2021
Copy link
Contributor

@yminqi yminqi left a comment

You are right. The crc is calculated based on used size, not aligned used size.

@openjdk
Copy link

@openjdk openjdk bot commented Mar 29, 2021

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

8264337: VM crashed when -XX:+VerifySharedSpaces

Reviewed-by: minqi, ccheung, shade

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

  • 1a681fa: 8263560: Remove needless wrapping with BufferedInputStream
  • 182b11c: 8264016: [JVMCI] add some thread local fields for use by JVMCI
  • 8cf1c62: 8263754: HexFormat 'fromHex' methods should be static
  • a5d7de2: 8263404: RsaPrivateKeySpec is always recognized as RSAPrivateCrtKeySpec in RSAKeyFactory.engineGetKeySpec
  • 128c0c9: 8248418: jpackage fails to extract main class and version from app module linked in external runtime
  • fd45694: 8264344: Outdated links in JavaComponentAccessibility.m
  • f17ea9e: 8262899: TestRedirectLinks fails
  • 963f1fc: 8264309: JFR: Improve .jfc parser
  • 364cce1: 8264332: Use the blessed modifier order in jdk.charsets
  • fbbd98b: 8264029: Replace uses of StringBuffer with StringBuilder in java.base
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/99b4bab366fe897e41a35240e474ea0cb0b229d5...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@yminqi, @calvinccheung, @shipilev) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Mar 29, 2021
Copy link
Member

@calvinccheung calvinccheung left a comment

LGTM.

@kelthuzadx
Copy link
Member Author

@kelthuzadx kelthuzadx commented Mar 30, 2021

Thanks @yminqi @calvinccheung for reviews!

/integrate

@openjdk openjdk bot added the sponsor label Mar 30, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 30, 2021

@kelthuzadx
Your change (at version 64780bc) is now ready to be sponsored by a Committer.

Copy link
Contributor

@shipilev shipilev left a comment

Minor nit.

out.shouldContain("OpenJDK");
out.shouldHaveExitValue(0);
}
}

This comment has been minimized.

@shipilev

shipilev Mar 30, 2021
Contributor

Please add the newline at the end of file here. See how UI complains about it :)

This comment has been minimized.

@kelthuzadx

kelthuzadx Mar 30, 2021
Author Member

Got it. But I'm not sure what's the abbreviation UI means... Could you please give me a link for that? Thanks!

This comment has been minimized.

@shipilev

shipilev Mar 30, 2021
Contributor

Thanks! I meant how GitHub UI (user interface) shows the red stop sign in cases like these.

@openjdk openjdk bot removed the sponsor label Mar 30, 2021
@kelthuzadx
Copy link
Member Author

@kelthuzadx kelthuzadx commented Mar 30, 2021

/integrate

@openjdk openjdk bot added the sponsor label Mar 30, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 30, 2021

@kelthuzadx
Your change (at version 0fe38b7) is now ready to be sponsored by a Committer.

*/

/*
* @test 8264337

This comment has been minimized.

@shipilev

shipilev Mar 30, 2021
Contributor

Sorry, one other minor nit. This should be:

@test
@bug 8264337
@openjdk openjdk bot removed the sponsor label Mar 30, 2021
Copy link
Contributor

@shipilev shipilev left a comment

Okay, we should be good to go. Thanks!

@kelthuzadx
Copy link
Member Author

@kelthuzadx kelthuzadx commented Mar 30, 2021

Thank you @shipilev, let me
/integrate
it again!

@openjdk openjdk bot added the sponsor label Mar 30, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 30, 2021

@kelthuzadx
Your change (at version 2d863d7) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Contributor

@shipilev shipilev commented Mar 30, 2021

I also ran runtime/cds tests without problem.

/sponsor

@openjdk openjdk bot closed this Mar 30, 2021
@openjdk openjdk bot added the integrated label Mar 30, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 30, 2021

@shipilev @kelthuzadx Since your change was applied there have been 19 commits pushed to the master branch:

  • 1a681fa: 8263560: Remove needless wrapping with BufferedInputStream
  • 182b11c: 8264016: [JVMCI] add some thread local fields for use by JVMCI
  • 8cf1c62: 8263754: HexFormat 'fromHex' methods should be static
  • a5d7de2: 8263404: RsaPrivateKeySpec is always recognized as RSAPrivateCrtKeySpec in RSAKeyFactory.engineGetKeySpec
  • 128c0c9: 8248418: jpackage fails to extract main class and version from app module linked in external runtime
  • fd45694: 8264344: Outdated links in JavaComponentAccessibility.m
  • f17ea9e: 8262899: TestRedirectLinks fails
  • 963f1fc: 8264309: JFR: Improve .jfc parser
  • 364cce1: 8264332: Use the blessed modifier order in jdk.charsets
  • fbbd98b: 8264029: Replace uses of StringBuffer with StringBuilder in java.base
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/99b4bab366fe897e41a35240e474ea0cb0b229d5...master

Your commit was automatically rebased without conflicts.

Pushed as commit bcdf469.

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

@dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Mar 30, 2021

The test fails on a non-OpenJDK build as it explicitly checks for "OpenJDK". Filed JDK-8264429.

@kelthuzadx kelthuzadx deleted the kelthuzadx:fix_verifysharedspace_crash branch Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants