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

JVM crashes on attach on Windows when compiled with /RTC1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-svc
    • None
    • b35
    • windows

        Compiling the function jvm_attach_thread_func in jdk/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c with /RTC1 generates code which is not runnable in another process. However during attach, jvm_attach_thread_func will be injected into the process space of another Java process. If it was compiled with /RTC1 it will crash on execution.

        The fix is simple. Just prevent the checks done by /RTC1 by using an appropriate pragma:

        /* Switch off all runtime checks (checks caused by /RTC<x>). They cause the
         * generated code to contain relative jumps to check functions which make
         * the code position dependent. */
        #pragma runtime_checks( "scu", off )
         DWORD WINAPI jvm_attach_thread_func(DataBlock *pData)

              stuefe Thomas Stuefe
              simonis Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: