Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266770

Clean pending exception before running dynamic CDS dump

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16, 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      The following two "if" blocks should be swapped. Otherwise a pre-existing exception may cause MetaspaceShared::link_and_cleanup_shared_classes() to fail.

      void JavaThread::invoke_shutdown_hooks() {
        HandleMark hm(this);

        // Link all classes for dynamic CDS dumping before vm exit.
        // Same operation is being done in JVM_BeforeHalt for handling the
        // case where the application calls System.exit().
        if (DynamicDumpSharedSpaces) {
          MetaspaceShared::link_and_cleanup_shared_classes(this);
        }

        // We could get here with a pending exception, if so clear it now.
        if (this->has_pending_exception()) {
          this->clear_pending_exception();
        }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              minqi Yumin Qi
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: