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

Crash in interpreter because get_unsigned_2_byte_index_at_bcp reads 4 bytes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • hs25
    • hs25
    • hotspot
    • None
    • b58
    • Not verified

        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

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

                Created:
                Updated:
                Resolved: