[jdk11u-dev] RFR: 8296812: sprintf is deprecated in Xcode 14 [v4]
Martin Doerr
mdoerr at openjdk.org
Wed Jul 17 13:48:01 UTC 2024
On Tue, 16 Jul 2024 19:56:28 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 incrementally with one additional commit since the last revision:
>
> Replace comment + newline in src/hotspot/share/adlc/adlc.hpp
https://github.com/openjdk/jdk11u-dev/pull/2835 should have been delayed until this fix is ready! Now, GHA is broken on MacOS!
-------------
PR Comment: https://git.openjdk.org/jdk11u-dev/pull/2836#issuecomment-2233362497
More information about the jdk-updates-dev
mailing list