JDK-8053902 : Fix for 8030115 breaks build on Windows and Solaris
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 8u60,9
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris,windows
  • CPU: generic
  • Submitted: 2014-07-29
  • Updated: 2017-07-26
  • Resolved: 2014-07-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b26Fixed
Related Reports
Duplicate :  
Description
The fix pushed for JDK-8030115 does not compile on Windows or Solaris, due to this part of the change:

@@ -195,16 +197,24 @@
     jvm_providers = (JVM_DTraceProvider*)calloc(
         num_providers, sizeof(*jvm_providers));
 
-    for (i = 0; i < num_providers; ++i) {
-        JVM_DTraceProvider* p = &(jvm_providers[i]);
+    int count = 0;
+    for (; count < num_providers; ++count) {
+        JVM_DTraceProvider* p = &(jvm_providers[count]);
         jobject provider = (*env)->GetObjectArrayElement(

The variable declaration in the middle of the function is causing an error.

Comments
I'm testing the following fix: diff --git a/src/share/native/sun/tracing/dtrace/JVM.c b/src/share/native/sun/tracing/dtrace/JVM.c --- a/src/share/native/sun/tracing/dtrace/JVM.c +++ b/src/share/native/sun/tracing/dtrace/JVM.c @@ -181,6 +181,7 @@ */ JNIEXPORT jlong JNICALL Java_sun_tracing_dtrace_JVM_activate0( JNIEnv* env, jclass cls, jstring moduleName, jobjectArray providers) { + int count = 0; jlong handle = 0; jsize num_providers; jsize i; @@ -197,7 +198,6 @@ jvm_providers = (JVM_DTraceProvider*)calloc( num_providers, sizeof(*jvm_providers)); - int count = 0; for (; count < num_providers; ++count) { JVM_DTraceProvider* p = &(jvm_providers[count]); jobject provider = (*env)->GetObjectArrayElement(
29-07-2014