-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8355561: [macos] Build failure with Xcode 16.3 #24937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
@mrserb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 192 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/reviewers 2 |
@@ -229,6 +237,9 @@ INT32 PORT_GetPortMixerDescription(INT32 mixerIndex, PortMixerDescription* mixer | |||
void* PORT_Open(INT32 mixerIndex) { | |||
TRACE1("\n>>PORT_Open (mixerIndex=%d)\n", (int)mixerIndex); | |||
PortMixer *mixer = (PortMixer *)calloc(1, sizeof(PortMixer)); | |||
if (!mixer) { | |||
return nullptr; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pre-existing bug; the caller code is already prepared to handle null.
id = nOpen(getMixerIndex()); |
ret = (jlong) (INT_PTR) PORT_Open(mixerIndex); |
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: #24608 (comment). |
Why not new and delete? |
In most cases, we allocate raw buffers that are filled by macOS. We could use "std::vector+try/catch" instead, but since malloc/free is already used in this code, I followed the same pattern for consistency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Looking forward to getting this fixed so I can build again... |
/integrate |
Going to push as commit 762423d.
Your commit was automatically rebased without conflicts. |
Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about llvm/llvm-project#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.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24937/head:pull/24937
$ git checkout pull/24937
Update a local copy of the PR:
$ git checkout pull/24937
$ git pull https://git.openjdk.org/jdk.git pull/24937/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24937
View PR using the GUI difftool:
$ git pr show -t 24937
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24937.diff
Using Webrev
Link to Webrev Comment