[11u] RFR: 8261089: [TESTBUG] native library of test TestCheckedReleaseCriticalArray.java fails to compile with gcc 4.x
Severin Gehwolf
sgehwolf at redhat.com
Mon Feb 8 12:40:42 UTC 2021
On Mon, 2021-02-08 at 16:48 +0530, Jayashree Huttanagoudar wrote:
>
> On Thu, Feb 4, 2021 at 7:18 AM Jayashree Huttanagoudar <jhuttana at redhat.com>
> wrote:
>
> > Hi,
> >
> > Could you please review this build fix for test-image on gcc 4.4.x
> > systems. JDK-8258077 is included with 11.0.11+1 and has an initial
> > declaration in the for loop. The fix is minor and makes the build proceed
> > further.This breaks our vanilla OpenJDK 11 builds. This isn't really
> > suitable for jdk/jdk as it's moved on to later toolchains. There is no
> > point in fixing this for later JDKs as those aren't going to be buildable
> > with those old compilers.
> >
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8261089
> >
> > Proposed Fix:
> > diff --git
> > a/test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c
> > b/test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c
> > index 28afd30..08da0c2 100644
> > ---
> > a/test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c
> > +++
> > b/test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c
> > @@ -35,7 +35,8 @@ Java_TestCheckedReleaseCriticalArray_modifyArray(JNIEnv
> > *env,
> > if (isCopy == JNI_FALSE) {
> > jint len = (*env)->GetArrayLength(env, iarr);
> > // make arbitrary changes to the array
> > - for (int i = 0; i < len; i++) {
> > + int i;
> > + for (i = 0; i < len; i++) {
> > arr[i] *= 2;
> > }
> > // write-back using JNI_COMMIT to test for memory leak
> >
> > Testing: Build of test-image target progress with this fix.
> >
> > Thoughts?
Looks fine to me and it fixes early access builds. I can sponsor the
fix for you!
Thanks,
Severin
More information about the jdk-updates-dev
mailing list