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

JvmtiAgentList::Iterator dtor double free with -fno-elide-constructors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 26
    • 25
    • hotspot
    • None

      While using a debug build with -fno-elide-constructors turned on, which turns off C++ Return Value Optimization, I get a crash because the JvmtiAgentList::Iterator destructor frees the same _stack object twice. This happens because code like

      Iterator it = xrun_agents();

      creates a temprary object. My understanding is that Return Value Optimization is not guaranteed with C++14, so we should not be relying on it for code correctness.

            amenkov Alex Menkov
            dlong Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: