-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8318696: Do not use LFS64 symbols on Linux #16329
Conversation
Hi @thesamesam, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user thesamesam" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
@thesamesam 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. |
I've already got an OCA processed for MySQL in the past. /signed |
I can't see a signup button for the bug tracker so I can't file an issue to include as a link. |
Submitted the bug: https://bugs.openjdk.org/browse/JDK-8318696 Please also go to https://github.com/thesamesam/jdk/actions and enable testing. The testing would normally trigger by new commit, but you can trigger it manually; select the "OpenJDK GHA Sanity Checks", then do "Run workflow" on the right, selecting the branch that corresponds to this PR. |
Thanks! |
I need to pipe config.h through to handle the x86 failure. I'll do that either today or the day after tomorrow. |
You are already a known contributor! |
3635172
to
ac8d33d
Compare
OK, this should be better now. I've checked with static asserts that the definition propagates and it also errors out without those anyway on incompat. ptr. types. |
The LFS64 symbols provided by glibc are not part of any standard and were gated behind -D_LARGEFILE64_SOURCE in musl 1.2.4 (to be removed in 1.2.5). This commit replaces the usage of LFS64 symbols with their regular counterparts and defines -D_FILE_OFFSET_BITS=64, ensuring that functions will always act as their -64 variants on glibc. Signed-off-by: Sam James <sam@gentoo.org>
ac8d33d
to
4432b9d
Compare
@thesamesam Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Webrevs
|
From what version of glibc can we be sure that the non-64 version is exactly equivalent to the 64 version for all these functions? There are also uses of some 64 functions in the JDK code as well. |
Fortunately, support for It dates back to 1997. The exception is for
This requires closer inspection to determine how broken they are outside of these changes. For some of the cases in the JDK code, My preference for moving forward is:
My hope is to separate these semantic changes from the equivalent-behaviour stuff both to ease review but also because there's a bunch of projects which need noop fixes like this still that I need to look at. I can't promise to be able to do 3) immediately though. I can probably start it soon, I just can't promise to get the whole thing done quickly. What do you think? |
I did a bit of archaeology here and have linked a number of existing JBS issues to JDK-8318696. I don't know the exact history as to why we chose to use LFS64 vs FOB64 (perhaps glibc version limitations?) but it is clear (e.g. from JDK-8062658) that there has been confusion about when to use the 64-bit variants in the JDK. For Hotspot I don't see any issue switching to FOB64 in place of LFS64. So the outlined plan seems good. |
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.
From a build perspective, this looks sane.
It is okay to start with making sure Hotspot is fully FOB64 before looking at the rest of the JDK libraries, but it would be good if those too eventually were addressed.
This has been a neglected issue for some time, so I'm happy to see that it gets some attention.
Note that the hotspot parts still require two Hotspot reviewers.
/reviewers 3
@thesamesam 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 no new commits pushed to the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@magicus, @dholmes-ora, @kimbarrett, @MBaesken) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@thesamesam This pull request has not yet been marked as ready for integration. |
/integrate |
@thesamesam |
I assume a separate issue will be needed for the JDK native libraries as there are quite a few LFS64 usages. |
Yes, please. I don't think I'm able to file one myself. |
/sponsor |
Going to push as commit f4d08cc. |
@kimbarrett @thesamesam Pushed as commit f4d08cc. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
We will need to backport this to at least OpenJDK 17 as well as OpenJDK 11, if possible. We had downstream reports of failure there in Gentoo. I haven't checked OpenJDK 8 although it's almost certainly needed there too. /backport jdk17u-dev |
@thesamesam To use the |
@thesamesam To use the |
Backport to 21u should also be done |
/backport jdk22u |
@MBaesken the backport was successfully created on the branch backport-MBaesken-f4d08ccf in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:
|
Could someone run the other commands again for older branches for me as well? I don't have access. |
Will look into 17 as well. Might make sense to have some other minor backports to jdk17u-dev before, to make the backport easier (maybe [almost] clean) . |
@AlanBateman @thesamesam I opened JDK-8324539 for the JDK libs. The implementation is trivial (#17538) but I am not sure how to understand the impact. My gut feeling is that if anything was wrong with this it would not even compile, but I need to understand this properly. |
Doesn't it mean going over the native code and replacing the LFS64 symbols with their regular counterparts? |
I'll take a look, give my thoughts on the problem overall. Let's discuss it over on that side if that's OK. |
That sounds reasonable. However, I expected functions like To my surprise, this does not seem to be the case -- either we have no instances of these LFS64 symbols in JDK libs, or they are still defined even though I removed |
The LFS64 symbols provided by glibc are not part of any standard and were gated behind -D_LARGEFILE64_SOURCE in musl 1.2.4 (to be removed in 1.2.5). This commit replaces the usage of LFS64 symbols with their regular counterparts and defines -D_FILE_OFFSET_BITS=64, ensuring that functions will always act as their -64 variants on glibc.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16329/head:pull/16329
$ git checkout pull/16329
Update a local copy of the PR:
$ git checkout pull/16329
$ git pull https://git.openjdk.org/jdk.git pull/16329/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16329
View PR using the GUI difftool:
$ git pr show -t 16329
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16329.diff
Webrev
Link to Webrev Comment