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

os::SuspendedThreadTask causes references to global operator delete

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • hotspot
    • None
    • b03
    • generic
    • generic

      The os::SuspendedThreadTask class is a base class with a virtual destructor. Because it has a virtual destructor and does not have an overriding definition for operator delete (either directly defined, or by inheriting from one of HotSpot's allocation base classes, neither of which it does), it's "deleting destructor" will refer to the global operator delete. That deleting destructor may be generated even if there are no calls to it. This reference to global operator delete prevents use of a link-time check for such to verify HotSpot code is not using the the C++ global heap.

      The simplest solution is probably to change the destructor from public and virtual to protected and non-virtual. That will work, so long as polymorphic deletion if derived objects is not required, and none of the existing uses need that.

      [Note: os::SuspendedThreadTask appears to only be used in code which is currently Oracle-closed.]

            coleenp Coleen Phillimore
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: