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

Potential double-free in ParallelSPCleanupTask constructor

    XMLWordPrintable

Details

    • b20

    Backports

      Description

        The ParallelSPCleanupTask class has a SubTasksDone member _subtasks. The constructor for ParallelSPCleanupTask initializes that member in the initializer list to a freshly constructed rvalue SubTasksDone.

        Fortunately, that extra SubTasksDone object is completely optimized away via RVO on most or all platforms, since SubTasksDone presently has a default copy constructor. Without the RVO optimization we'd have a double-free of the internal array in the SubTasksDone object that gets constructed by the normal constructor and deleted by the destructor. (SubTasksDone probably ought to be noncopyable; that would have prevented the problem code from compiling in the first place.)

        Attachments

          Issue Links

            Activity

              People

                dbuck David Buck
                kbarrett Kim Barrett
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: