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

AsyncLogWriter should not overide is_Named_thread()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic
    • OS:
      generic

      Description

      Comments from David Holmes:
      "
      BTW: I noticed a separate bug in the crash log. You've defined:

      bool is_Named_thread() const override { return true; }

      for the AsyncLogWriter, but as you pointed out when I asked, this thread
      can't be a NamedThread because that is a special kind of GC thread. So
      that method should not be there.
      "

      I misunderstood is_Named_thread(). I thought it should return true as long as it has a name. It's incorrect! Only NamedThread and its subclasses return true.

      Code like this is undefined for AsyncLogWriter. Its vtable doesn't have the entry for gc_id().

      uint GCId::current_or_undefined() {
        return Thread::current()->is_Named_thread() ? currentNamedthread()->gc_id() : undefined();
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              xliu Xin Liu
              Reporter:
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: