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

java_lang_Thread::async_get_stack_trace does not properly protect JavaThread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • hotspot
    • None
    • generic
    • generic

      src/hotspot/share/runtime/threadSMR.hpp has an example of the correct usage of ThreadsListHandle to protect JavaThread:
      // ThreadsListHandle tlh;
      // JavaThread* jt = nullptr;
      // bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &jt, nullptr);
      // if (is_alive) {
      // : // do stuff with 'jt'...
      // }

      java_lang_Thread::async_get_stack_trace() does not follow the pattern, but does:
      JNIHandles::resolve(jthread) (in JVM_GetStackTrace)
      ThreadsListHandle tlh(JavaThread::current());
      JavaThread* thread = java_lang_Thread::thread(java_thread);

            amenkov Alex Menkov
            amenkov Alex Menkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: