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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 14
    • 14
    • hotspot
    • None
    • b15

      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
      }

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

              Created:
              Updated:
              Resolved: