JDK-8224033 : os::snprintf should be used in virtualizationSupport.cpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,13
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-05-16
  • Updated: 2019-08-15
  • Resolved: 2019-05-16
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 JDK 13
11.0.5Fixed 13 b22Fixed
Related Reports
Relates :  
Relates :  
Description
Windows x86_64:

c:/cygwin64/home/windows/worker/jdkX-windows/build/src/hotspot/share/utilities/virtualizationSupport.cpp(68) : error C3861: 'snprintf': identifier not found
c:/cygwin64/home/windows/worker/jdkX-windows/build/src/hotspot/share/utilities/virtualizationSupport.cpp(74) : error C3861: 'snprintf': identifier not found
make[3]: *** [lib/CompileJvm.gmk:177: /cygdrive/c/cygwin64/home/windows/worker/jdkX-windows/build/build/windows-x86_64-server-release/hotspot/variant-server/libjvm/objs/virtualizationSupport.obj] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [make/Main.gmk:257: hotspot-server-libs] Error 2

I think #include <stdio.h> is missing in newly added virtualizationSupport.cpp. Probably only no-PCH build is affected.
Comments
Fix Request I would like to have the patch as well in jdk11, because it is needed in jdk11 as well together with JDK-8222720 (where I requested downport to jdk11). The patch applies cleanly (when applied on top of 8222720 where it belongs to).
18-06-2019

RFR: https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-May/038158.html
16-05-2019

Thanks, please take over ! os::snprintf sounds like a good idea .
16-05-2019

I think os::snprintf should be used, like in JDK-8219583 and because of JDK-8198918. Something like this: 8224033: Windows build fails after JDK-8222720 Reviewed-by: XXX diff -r 3e1ecfd3ea18 -r 1c04ed9cbcd7 src/hotspot/share/utilities/virtualizationSupport.cpp --- a/src/hotspot/share/utilities/virtualizationSupport.cpp Mon May 13 07:41:32 2019 -0700 +++ b/src/hotspot/share/utilities/virtualizationSupport.cpp Thu May 16 12:48:26 2019 +0200 @@ -65,13 +65,13 @@ VMGuestLibError sg_error = GuestLib_StatGet("text", "resources", &result_info, &result_size); if (sg_error == VMGUESTLIB_ERROR_SUCCESS) { has_resource_information = true; - snprintf(extended_resource_info_at_startup, sizeof(extended_resource_info_at_startup), "%s", result_info); + os::snprintf(extended_resource_info_at_startup, sizeof(extended_resource_info_at_startup), "%s", result_info); GuestLib_StatFree(result_info, result_size); } sg_error = GuestLib_StatGet("text", "host", &result_info, &result_size); if (sg_error == VMGUESTLIB_ERROR_SUCCESS) { has_host_information = true; - snprintf(host_information, sizeof(host_information), "%s", result_info); + os::snprintf(host_information, sizeof(host_information), "%s", result_info); GuestLib_StatFree(result_info, result_size); } } I can take over, if you want.
16-05-2019

Our Windows build (using VS2017) is fine. But we do not disable PCH there, this might be the difference. submit-repo was okay yesterday today (whatever this tests).
16-05-2019