changeset 14245:768421ed8211

Merge
author hseigel
date Mon, 13 Jan 2014 18:30:57 -0500
parents d85f79f0c476 (diff) db1ff6781ab4 (current diff)
children afa21611f918
files
diffstat 4 files changed, 20 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/windows/vm/os_windows.cpp	Fri Jan 10 12:54:08 2014 -0800
+++ b/src/os/windows/vm/os_windows.cpp	Mon Jan 13 18:30:57 2014 -0500
@@ -166,12 +166,10 @@
   return;
 }
 
-#ifndef _WIN64
 // previous UnhandledExceptionFilter, if there is one
 static LPTOP_LEVEL_EXCEPTION_FILTER prev_uef_handler = NULL;
 
 LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo);
-#endif
 void os::init_system_properties_values() {
   /* sysclasspath, java_home, dll_dir */
   {
@@ -2240,11 +2238,11 @@
   return EXCEPTION_CONTINUE_EXECUTION;
 }
 
-#ifndef  _WIN64
 //-----------------------------------------------------------------------------
 LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) {
+  PCONTEXT ctx = exceptionInfo->ContextRecord;
+#ifndef  _WIN64
   // handle exception caused by native method modifying control word
-  PCONTEXT ctx = exceptionInfo->ContextRecord;
   DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode;
 
   switch (exception_code) {
@@ -2270,17 +2268,11 @@
     // UnhandledExceptionFilter.
     return (prev_uef_handler)(exceptionInfo);
   }
-
-  return EXCEPTION_CONTINUE_SEARCH;
-}
-#else //_WIN64
+#else // !_WIN64
 /*
   On Windows, the mxcsr control bits are non-volatile across calls
   See also CR 6192333
-  If EXCEPTION_FLT_* happened after some native method modified
-  mxcsr - it is not a jvm fault.
-  However should we decide to restore of mxcsr after a faulty
-  native method we can uncomment following code
+  */
       jint MxCsr = INITIAL_MXCSR;
         // we can't use StubRoutines::addr_mxcsr_std()
         // because in Win64 mxcsr is not saved there
@@ -2288,10 +2280,10 @@
         ctx->MxCsr = MxCsr;
         return EXCEPTION_CONTINUE_EXECUTION;
       }
-
-*/
-#endif //_WIN64
-
+#endif // !_WIN64
+
+  return EXCEPTION_CONTINUE_SEARCH;
+}
 
 // Fatal error reporting is single threaded so we can make this a
 // static and preallocated.  If it's more than MAX_PATH silently ignore
@@ -2640,7 +2632,6 @@
 
       } // switch
     }
-#ifndef _WIN64
     if (((thread->thread_state() == _thread_in_Java) ||
         (thread->thread_state() == _thread_in_native)) &&
         exception_code != EXCEPTION_UNCAUGHT_CXX_EXCEPTION)
@@ -2648,7 +2639,6 @@
       LONG result=Handle_FLT_Exception(exceptionInfo);
       if (result==EXCEPTION_CONTINUE_EXECUTION) return result;
     }
-#endif //_WIN64
   }
 
   if (exception_code != EXCEPTION_BREAKPOINT) {
--- a/src/share/vm/classfile/classFileParser.cpp	Fri Jan 10 12:54:08 2014 -0800
+++ b/src/share/vm/classfile/classFileParser.cpp	Mon Jan 13 18:30:57 2014 -0500
@@ -4098,8 +4098,12 @@
         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
                    cfs->source());
       } else if (class_loader.is_null()) {
-        if (THREAD->is_Java_thread()) {
-          Klass* caller = ((JavaThread*)THREAD)->security_get_caller_class(1);
+        Klass* caller =
+            THREAD->is_Java_thread()
+                ? ((JavaThread*)THREAD)->security_get_caller_class(1)
+                : NULL;
+        // caller can be NULL, for example, during a JVMTI VM_Init hook
+        if (caller != NULL) {
           tty->print("[Loaded %s by instance of %s]\n",
                      this_klass->external_name(),
                      InstanceKlass::cast(caller)->external_name());
--- a/src/share/vm/trace/tracetypes.xml	Fri Jan 10 12:54:08 2014 -0800
+++ b/src/share/vm/trace/tracetypes.xml	Mon Jan 13 18:30:57 2014 -0500
@@ -85,12 +85,6 @@
       <value type="UTF8" field="name" label="Name"/>
     </content_type>
 
-    <content_type id="StackTrace" hr_name="Stacktrace"
-                  type="U8" builtin_type="STACKTRACE">
-      <value type="BOOLEAN" field="truncated" label="Truncated"/>
-      <structarray type="StackFrame" field="frames" label="Stack frames"/>
-    </content_type>
-
     <content_type id="Class" hr_name="Java class"
                   type="U8" builtin_type="CLASS">
       <value type="CLASS" field="loaderClass" label="ClassLoader"/>
@@ -116,17 +110,6 @@
       <value type="UTF8" field="name" label="Name"/>
     </content_type>
 
-    <content_type id="FrameType" hr_name="Frame type"
-                  type="U1" jvm_type="FRAMETYPE">
-      <value type="UTF8" field="desc" label="Description"/>
-    </content_type>
-
-    <struct_type id="StackFrame">
-      <value type="METHOD" field="method" label="Java Method"/>
-      <value type="INTEGER" field="line" label="Line number"/>
-      <value type="FRAMETYPE" field="type" label="Frame type"/>
-    </struct_type>
-
     <content_type id="GCName" hr_name="GC Name"
                   type="U1" jvm_type="GCNAME">
       <value type="UTF8" field="name" label="name" />
--- a/test/runtime/jsig/Test8017498.sh	Fri Jan 10 12:54:08 2014 -0800
+++ b/test/runtime/jsig/Test8017498.sh	Mon Jan 13 18:30:57 2014 -0500
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-#  Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+#  Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 #  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 #  This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 ## @bug 8017498
 ## @bug 8020791
 ## @bug 8021296
+## @bug 8022301
 ## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX
 ## @run shell/timeout=30 Test8017498.sh
 ##
@@ -42,6 +43,8 @@
 ## Adding common setup Variables for running shell tests.
 . ${TESTSRC}/../../test_env.sh
 
+EXTRA_CFLAG=
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -57,6 +60,7 @@
         MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}amd64${FS}libjsig.so
     else
         MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}i386${FS}libjsig.so
+        EXTRA_CFLAG=-m32
     fi
     echo MY_LD_PRELOAD = ${MY_LD_PRELOAD}
     ;;
@@ -72,6 +76,7 @@
 ${TESTJAVA}${FS}bin${FS}javac *.java
 
 $gcc_cmd -DLINUX -fPIC -shared \
+    ${EXTRA_CFLAG} -z noexecstack \
     -o ${TESTSRC}${FS}libTestJNI.so \
     -I${TESTJAVA}${FS}include \
     -I${TESTJAVA}${FS}include${FS}linux \