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

Memory corruption in the implementation of the stack walk API

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 11, 13, 14
    • Fix Version/s: None
    • Component/s: hotspot
    • Subcomponent:
    • Introduced In Version:
      9

      Description

      The java/lang/StackFrameInfo class declares a field called 'bci' with type short.
      The support in the JVM to update this field incorrectly uses a method writing an int:

      void java_lang_StackFrameInfo::set_bci(oop element, int value) {
          element->int_field_put(_bci_offset, value);
      }

      The size of an int being 4 bytes, and the size of a short being 2 bytes, when this method is called, it overwrites the next two bytes after the bci field.

      Correct implementation of this method is:

      void java_lang_StackFrameInfo::set_bci(oop element, int value) {
          element->short_field_put(_bci_offset, value);
      }

        Attachments

          Activity

            People

            • Assignee:
              fparain Frederic Parain
              Reporter:
              fparain Frederic Parain
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: