RFR: 8355561: [macos] Build failure with Xcode 16.3

Sergey Bylokhov serb at openjdk.org
Mon Apr 28 22:02:49 UTC 2025


On Mon, 28 Apr 2025 19:47:03 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about https://github.com/llvm/llvm-project/issues/62836
> 
> jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
>   127 | AudioDeviceID devices[count];
>       | ^~~~~
> jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: note: read of non-const variable 'count' is not allowed in a constant expression
> jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:126:21: note: declared here
>   126 | int count = size/sizeof(AudioDeviceID);
> 
> The usage of VLA has been replaced with malloc/calloc and free, which are already used in this file.
> 
> Note that while this patch adds some validation, I am pretty sure it is still possible to crash these code paths if they are executed concurrently. Access to the native pointers being passed around is not properly synchronized.

Note that the build is broken not only due to this issue, but also due to another recently introduced problem, which is mentioned in the following link: https://github.com/openjdk/jdk/pull/24608#issuecomment-2833849941.

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

PR Comment: https://git.openjdk.org/jdk/pull/24937#issuecomment-2836827606


More information about the client-libs-dev mailing list