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

Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: hs25
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b58
    • Verification:
      Not verified

      Backports

        Description

        Scenario:
        A ConstMethod is the last allocated object in a VirtualSpaceNode, such that the very byte after the end of the byte code stream is unmapped.
        The last two bytecodes are:
        - checkcast #6 0xc0 0x00 0x06
        - areturn 0xb0
        - UNMAPPED MEMORY

        At the checkcast we use InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp to load the constant pool index for the checkcast, that function uses:
        "mov 0x1(%esi),%ebx" (%esi is the bcp)

        This a 4 byte load, so the last byte read will actually end up in the unmapped memory right after the areturn and we'll get a SEGV.


        I=H (VM crash)
        L=L (unlikely situation)
        W=H (no known workaround)
        =>P2

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mgerdin Mikael Gerdin (Inactive)
                  Reporter:
                  mgerdin Mikael Gerdin (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: