8059868: JVM crashes on attach on Windows when compiled with /RTC1
Reviewed-by: alanb, sla
Contributed-by: thomas.stuefe@sap.com
--- 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