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

No required ResourceMark in src/hotspot/share/prims/jvmtiImpl.cpp:JvmtiSuspendControl::print()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b15

      Description

      File
      src/hotspot/share/prims/jvmtiImpl.cpp
      has several methods which might be used to trace jvmti events.

      JvmtiSuspendControl::print() fails with crash because it don't have resource mark.


      diff -r 4364524f8cac src/hotspot/share/prims/jvmtiImpl.cpp
      --- a/src/hotspot/share/prims/jvmtiImpl.cpp Fri Aug 30 09:38:40 2019 +0800
      +++ b/src/hotspot/share/prims/jvmtiImpl.cpp Wed Sep 11 00:35:57 2019 +0000
      @@ -881,6 +881,7 @@

       void JvmtiSuspendControl::print() {
       #ifndef PRODUCT
      + ResourceMark rm;
         LogStreamHandle(Trace, jvmti) log_stream;
         log_stream.print("Suspended Threads: [");
         for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {

      Complete method is

      void JvmtiSuspendControl::print() {
      #ifndef PRODUCT
        LogStreamHandle(Trace, jvmti) log_stream;
        log_stream.print("Suspended Threads: [");
        for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
      #ifdef JVMTI_TRACE
          const char *name = JvmtiTrace::safe_get_thread_name(thread);
      #else
          const char *name = "";
      #endif /*JVMTI_TRACE */
          log_stream.print("%s(%c ", name, thread->is_being_ext_suspended() ? 'S' : '_');
          if (!thread->has_last_Java_frame()) {
            log_stream.print("no stack");
          }
          log_stream.print(") ");
        }
        log_stream.print_cr("]");
      #endif
      }

        Attachments

          Activity

            People

            • Assignee:
              lmesnik Leonid Mesnik
              Reporter:
              lmesnik Leonid Mesnik
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: