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

C2: allocate PhaseIdealLoop::_loop_or_ctrl from C->comp_arena()

    XMLWordPrintable

Details

    • b25
    • 21
    • b10

    Backports

      Description

        If we don't do that, then this array is ResourceArea allocated. That means we can get in trouble with ResourceMarks inside the PhaseIdealLoop. If the array is updated because of new nodes, and this grows the area in a ResourceMark scope, then the data behind _loop_or_ctrl becomes invalid, and we get use-after-free memory corruption bugs.

        The array was added in JDK-8302670, hence this is a fix to that regression. We should backport down to JDK21.

        I don't yet have a reproducer. But this triggered with my patch for JDK-8325589.

        Attachments

          Issue Links

            Activity

              People

                epeter Emanuel Peter
                epeter Emanuel Peter
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: