[jdk11u-dev] RFR: 8296812: sprintf is deprecated in Xcode 14 [v3]

George Adams gdams at openjdk.org
Tue Jul 16 10:48:55 UTC 2024


On Tue, 9 Jul 2024 08:43:46 GMT, Antonio Vieiro <duke at openjdk.org> wrote:

>> Backport of [JDK-8296812](https://bugs.openjdk.org/browse/JDK-8296812) .
>> 
>> The new GHA build platform (macos-13 / XCode 14) fails because  `sprintf` is deprecated. An alternative (`os::snprintf_checked`) was introduced in JDK-8296812.
>> 
>> This is sadly not a clean backport, as different issues have not been backported to 11 (JDK-8324824, JDK-8303575, JDK-8301050, JDK-8298472, JDK-8298472 to name a few). 
>> 
>> The backport required changes to the following files:
>> 
>> 
>> src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
>> src/hotspot/os/bsd/os_bsd.cpp
>> src/hotspot/share/adlc/adlc.hpp
>> src/hotspot/share/adlc/adlparse.cpp
>> src/hotspot/share/adlc/formssel.cpp
>> src/hotspot/share/adlc/output_c.cpp
>> src/hotspot/share/c1/c1_Runtime1.cpp
>> src/hotspot/share/compiler/compileBroker.cpp
>> src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
>> src/hotspot/share/runtime/perfData.cpp
>> src/hotspot/share/utilities/utf8.cpp
>> 
>> 
>> And these files were not backported:
>> 
>> 
>> src/hotspot/share/cds/filemap.cpp
>> src/hotspot/share/interpreter/bootstrapInfo.cpp
>> src/hotspot/share/jfr/support/jfrSymbolTable.cpp
>> 
>> 
>> While we are at it,  this change also replaces `strcat` in `src/hotspot/cpu/aarch64/vm_version_aarch64.cpp` with the newly introduced `os::snprintf_checked` to avoid possible buffer overflows.
>> 
>> Builds on the new `macos-13`  will continue to fail until different issues are backported. The new macos builds report a clash with the standard `assert` macro (see [1]) what suggests that [JDK-8299254](https://bugs.openjdk.org/browse/JDK-8299254) "Support dealing with standard assert macro" should be backported next.
>> 
>> [1]
>> 
>> In file included from /Users/runner/work/jdk11u-dev/jdk11u-dev/test/hotspot/gtest/jfr/test_networkUtilization.cpp:223:
>> /Users/runner/work/jdk11u-dev/jdk11u-dev/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp:58:25: error: too many arguments provided to function-like macro invocation
>>   assert(iface != NULL, "invariant");
>
> Antonio Vieiro has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains one additional commit since the last revision:
> 
>   Backport 478ef389dc3767edfbe21d10a7f7f1522c648c2e

Changes LGTM once [src/hotspot/share/adlc/adlc.hpp](https://github.com/openjdk/jdk11u-dev/pull/2836/files/e5d3f6e5d8bfb8210aaf495c98f7f0d482dc1010#diff-d574237633a315bda2b3fe234f26c730167ba9795406029303870eb26269533e) is resolved

-------------

PR Comment: https://git.openjdk.org/jdk11u-dev/pull/2836#issuecomment-2230588975


More information about the jdk-updates-dev mailing list