-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8299635: Hotspot update for deprecated sprintf in Xcode 14 #11935
Conversation
👋 Welcome back xuelei! A progress list of the required criteria for merging this PR into |
@XueleiFan The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
This PR does not address all the remaining sprintf:s in hotspot, and with it now explicitly forbidden the build will fail:
I count ~30 sprintf:s that need updating. I'm also curious: some of the sprintfs are C2 (src/hotspot/share/opto) - are your builds including C2? If so, why are you not running into the issue for those files? |
This is a question to me as well. I noticed there are still some use of sprintf, but the building passed on MacOS and Linux. I was wondering if the following update really work (if the '...' parameter works for the forbidden?), or something else matters.
I'm new to hotspot. Do you know how could I enable C2? Thanks! |
Never mind, I got it from configuration help message (use --with-jvm-features=compiler2). |
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 looks good.
Thank you for fixing it.
Serguei
There are more uses of sprintf in some serviceability folders:
|
@XueleiFan 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 183 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 |
@XueleiFan Could you, please, do not integrate until more cases with the same problem are fixed? |
@sspitsyn Only the author (@XueleiFan) is allowed to issue the |
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.
More cases with the same issue were found.
Sure. That's on my plan. I am trying to figure out how to get these files included in the building. My build passed on MacOS and Linux, even with C2 enabled. The update on test may be different from src update. I may divide the fix into two PRs, if I figure out how to build the missing uses of sprintf:s. Thank for for the feedback. I appreciated it. |
Thank you for making these additional changes! I'm still seeing some issue building on linux-x64, for example:
|
Yes. There are at least 57 src files that use sprintf function in components other than hotspot, as far as I can see. This PR is pretty big now. I would like to clean them up in an other PR so that it is easier to review. |
I would suggest constraining this PR to src/hotspot and test/hotspot and deal with the JDK serviceability files in a different PR (and there may be other JDK files impacted too). |
I agreed. This PR is mainly focus on the hotspot, except two test files for jdk management. The test clean up is done with this PR, but there are still a lot (57+) use in other src component. One or more PR will be filed for the remaining clean up. |
I would suggest leaving those two management files for the serviceability PR. |
I was (still) puzzled by the remaining sprintf:s in the JDK and the fact that the build completed successfully even if not all of them had been address/updated, so I investigated it a bit and came to the conclusion that the Xcode/clang warning (which we turn into an error with For many reasons we may still want to fix the remaining occurrences as well, but for the immediate case of the new Xcode version it seems to be sufficient to fix the C++ files. |
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.
Nothing further from me. I think this is okay as-is now. Thanks.
@sspitsyn I'm going to integrate the changeset. Did you have further comment or need more time? |
@dholmes-ora Thank you for the review! |
@XueleiFan You need two reviews before integrating a Hotspot change - thanks. |
May I get one more reviewer for this PR? Thanks! |
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, thank you for doing this!
@vidmik Thank you! |
/integrate |
Going to push as commit e80b5ea.
Your commit was automatically rebased without conflicts. |
@XueleiFan Pushed as commit e80b5ea. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The sprintf is deprecated in Xcode 14 because of security concerns. The issue was addressed in JDK-8296812 for hotspot impl, and JDK-8299378 for building, but the test case was not covered. The failure was reported in PR 11793, while running tier1 testing.
This patch is trying to find the use of sprintf in hotspot iml and test cases.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11935/head:pull/11935
$ git checkout pull/11935
Update a local copy of the PR:
$ git checkout pull/11935
$ git pull https://git.openjdk.org/jdk pull/11935/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11935
View PR using the GUI difftool:
$ git pr show -t 11935
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11935.diff