JDK-8261089 : [TESTBUG] native library of test TestCheckedReleaseCriticalArray.java fails to compile with gcc 4.x
  • Type: Bug
  • Component: hotspot
  • Sub-Component: test
  • Affected Version: 11.0.11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2021-02-03
  • Updated: 2021-02-10
  • Resolved: 2021-02-08
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 11
11.0.11 b02Fixed
Related Reports
Relates :  
Relates :  
Description
When trying to compile the test-images target on RHEL 6 or RHEL 7 we see build failures like this:

=== Output from failing command(s) repeated here ===
/bin/printf "* For target support_test_hotspot_jtreg_native_support_libTestCheckedReleaseCriticalArray_libTestCheckedReleaseCriticalArray.o:\n" 
* For target support_test_hotspot_jtreg_native_support_libTestCheckedReleaseCriticalArray_libTestCheckedReleaseCriticalArray.o:
(/bin/grep -v -e "^Note: including file:" <  /home/openjdk/jdk11u/build/release/make-support/failure-logs/support_test_hotspot_jtreg_native_support_libTestCheckedReleaseCriticalArray_libTestCheckedReleaseCriticalArray.o.log || true) | /bin/head -n 15 
./test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c: In function ���Java_TestCheckedReleaseCriticalArray_modifyArray���:
./test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c:38:5: error: ���for��� loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < len; i++) {
     ^
./test/hotspot/jtreg/runtime/jni/checked/libTestCheckedReleaseCriticalArray.c:38:5: note: use option -std=c99 or -std=gnu99 to compile your code
if test `/bin/wc -l < /home/openjdk/jdk11u/build/release/make-support/failure-logs/support_test_hotspot_jtreg_native_support_libTestCheckedReleaseCriticalArray_libTestCheckedReleaseCriticalArray.o.log` -gt 15; then /bin/echo "   ... (rest of output omitted)" ; fi 
/bin/printf "\n* All command lines available in /home/openjdk/jdk11u/build/release/make-support/failure-logs.\n" 

* All command lines available in /home/openjdk/jdk11u/build/release/make-support/failure-logs.
/bin/printf "=== End of repeated output ===\n"  
=== End of repeated output ===
if /bin/grep -q "recipe for target .* failed" /home/openjdk/jdk11u/build/release/build.log 2> /dev/null; then /bin/printf "\n=== Make failed targets repeated here ===\n" ; /bin/grep "recipe for target .* failed" /home/openjdk/jdk11u/build/release/build.log ; /bin/printf "=== End of repeated output ===\n" ; /bin/printf "\nHint: Try searching the build log for the name of the first failed target.\n" ; else /bin/printf "\nNo indication of failed target found.\n" ; /bin/printf "Hint: Try searching the build log for '] Error'.\n" ; fi

That test got introduced with the backport of JDK-8258077 the fix should be similar to JDK-8256483. There is no point in fixing this for later JDKs as those aren't going to be buildable with those old compilers.
Comments
URL: https://hg.openjdk.java.net/jdk-updates/jdk11u/rev/7b7a18a77d1b User: goetz Date: 2021-02-10 08:28:35 +0000
10-02-2021

URL: https://hg.openjdk.java.net/jdk-updates/jdk11u-dev/rev/7b7a18a77d1b User: sgehwolf Date: 2021-02-08 14:15:46 +0000
08-02-2021

Fix Request (OpenJDK 11u): Please approve this test-only fix for OpenJDK 11.0.11 as it breaks early access builds we produce for Linux. The fix is rather trivial too. I'll sponsor the fix for Jayashree once approved for JDK 11u. RFR (approved; with patch in-line): https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-February/004901.html
08-02-2021

We are seeing this since trying to produce 11.0.11+1 ea builds.
03-02-2021

Assigning to myself on behalf of Jayashree Huttanagoudar who has a fix for this.
03-02-2021