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

[lworld] Memory corruption due to out of bound access in MacroAssembler::move_helper

XMLWordPrintable

      Out of bounds memory accesses in MacroAssembler::move_helper due to from->value() == -1 lead to memory corruption manifesting in weird crashes like below:

        // Update register states
        reg_state[from->value()] = reg_writable;
        reg_state[to->value()] = reg_written;


      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f5781a28a5d, pid=5895, tid=5913
      #
      # JRE version: Java(TM) SE Runtime Environment (18.0) (fastdebug build 18-lworld3ea+0-2021-07-27-1101206.david.simms.valhalla)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-lworld3ea+0-2021-07-27-1101206.david.simms.valhalla, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # C [libc.so.6+0x8fa5d] __memset_sse2+0x5d

      Current CompileTask:
      C2: 1733 252 b compiler.valhalla.inlinetypes.MyValue1::<init> (90 bytes)

      Stack: [0x00007f57532fb000,0x00007f57533fc000], sp=0x00007f57533fa798, free space=1021k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      C [libc.so.6+0x8fa5d] __memset_sse2+0x5d
      V [libjvm.so+0x80cb09] ResourceMarkImpl::~ResourceMarkImpl()+0x99
      V [libjvm.so+0xa66342] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x822
      V [libjvm.so+0xa67328] CompileBroker::compiler_thread_loop()+0x598
      V [libjvm.so+0x196b50c] JavaThread::thread_main_inner()+0x27c
      V [libjvm.so+0x1971790] Thread::call_run()+0x100
      V [libjvm.so+0x16233f4] thread_native_entry(Thread*)+0x104

            thartmann Tobias Hartmann
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: