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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 26
    • Affects Version/s: 25
    • Component/s: hotspot
    • None
    • b06

      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.

            Assignee:
            Alex Menkov
            Reporter:
            Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: