8059868: JVM crashes on attach on Windows when compiled with /RTC1
authorsimonis
Tue, 07 Oct 2014 15:14:05 +0200
changeset 26969 ca3ea2ba7c86
parent 26968 cd59eb37868e
child 26970 51018a2f505d
8059868: JVM crashes on attach on Windows when compiled with /RTC1 Reviewed-by: alanb, sla Contributed-by: thomas.stuefe@sap.com
jdk/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c
--- a/jdk/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c	Wed Oct 08 11:51:36 2014 -0400
+++ b/jdk/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c	Tue Oct 07 15:14:05 2014 +0200
@@ -92,6 +92,10 @@
  * Code copied to target process
  */
 #pragma check_stack (off)
+/* 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)
 {
     HINSTANCE h;
@@ -122,7 +126,7 @@
 void jvm_attach_thread_func_end (void) {
 }
 #pragma check_stack
-
+#pragma runtime_checks ("scu", restore)
 
 /*
  * Class:     sun_tools_attach_VirtualMachineImpl