-
Notifications
You must be signed in to change notification settings - Fork 234
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
8288763: Pack200 extraction failure with invalid size #1163
Conversation
👋 Welcome back tsteele! A progress list of the required criteria for merging this PR into |
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.
Changes look good to me.
I would like to see a short comment, explaining why it is necessary to reset the compressed size. Looking at the class declaration, I see all members being preset with some value. Is the same instance (re)used multiple times?
Additional "issue": I'm not a Reviewer for the jdk-updates project. Someone else will need to jump in here, maybe @TheRealMDoerr
I agree, some more comments could be helpful or at least some explanation of the fix in the JBS bug. Maybe it is a similar issue as was fixed for java.util.zip by @simonis with https://bugs.openjdk.org/browse/JDK-8253952 ? |
This is all a little bit confusing. First of all I don't think that this issue is s390 related. I think it should be independent of the platform and only depend on the source zip file and the zlib version used by the JDK. Unless we can't proof that this is indeed s390 related, please remove the "[s390]" tag from the summary to avoid further confusion. From the JBS issue you've opened I see that you're running JCK tests when you encountered this issue. You can find the source zip files of these tests under
Then, do the following:
In the last step, if you find an entry with a compressed size which is different from the compressed size of that same entry in the original file then the root cause of your problem is indeed JDK-8253952 as @RealCLanger suspected. I that case your fix is also correct and I'll be happy to approve it. I agree with @RealCLanger that this issue is probably another variant of JDK-8253952 (and that JBS issue has several links to other variants with the same root cause). I just want to make sure that we're really seeing the same issue here and don't have another hidden bug on s390. |
Thanks for your feedback @simonis, @RealCLanger and @RealLucy.
I think this is a good suggestion, and it's on my todo list.
This is likely my mistake. A member of the Linux on s390 team reported the issue to me, and I must have assumed it was related to that platform. Sorry for the confusion; I have removed the s390 tag in JBS.
Yes. Though I won't have access to this system until next week. I will report back when I have this information. |
It took me a bit longer than anticipated to get to this. Below is the output you requested @simonis.
Looks like it is dynamically linked:
You had the version right on.
Following the remaining steps shows a different compressed size.
|
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.
Hi @backwaterred,
Thanks for running the additional tests, really appreciated.
As I said before, I think your changes are fine and I'll approve them.
If you have some extra time to dig into this issue it would still be interesting to find out why the same zlib version 1.2.11 produces different compressed sizes on x86_64 and s390. Do you know if the native zlib on your system contains some extra changes or enhancements compared to the upstream version? And by the way, what Linux distro did you observe this issue?
One way to find this out would be to build you JDK under test with a statically linked zlib version (i.e. --with-zlib=bundled
). This will use the original 1.2.11 zlib sources which are bundled with OpenJDK. If this statically linked JDK behaves differently this would indicate that there's some "secrete sauce" in your platforms native zlib. That doesn't mean that there's something wrong about it. It's just the JDK which is not prepared for it :)
@backwaterred This change now passes all automated pre-integration checks. 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 56 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. 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 (@RealLucy, @simonis) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@simonis Thanks for your review! I appreciate having an extra set of eyes on the changes as well.
Yes 😏 this was discovered on an IBM zLinux machine with a hardware accelerated zlib. It's special sauce galore! The OS is Ubuntu 20.04, and has been seen on RHEL 8.6 as well. |
/integrate |
@backwaterred |
Thanks for the additional information. You should have said that right from the beginning :) Interesting to see how the hardware acceleration seems to trade speed for compression ratio (the newly compressed files are all slightly bigger) in the same way the other, purely software based zlib enhancements are doing this (see for example https://github.com/simonis/zlib-bench/blob/master/Results.md). You should also be aware that this difference in behavior can impact other code, both in the JDK core libraries as well as in user code. JDK-8253952: Refine ZipOutputStream.putNextEntry() to recalculate ZipEntry's compressed size has a detailed explanation of why this problem occurs along with a list of some internal classes which have been fixed and some external libraries which are affected. Ideally, you should downport JDK-8253952 which fixes the root of the problem and not just a single affected caller like your current fix. But unfortunately, that can't be done straight away because it changes the public API specification and has an associated CSR. Maybe it will be acceptable to only downport the code fix part of JDK-8253952? |
Hi @backwaterred, in JDK-Updates projects you must not issue /integrate only when a PR is ready. You also need to get maintainer approval by putting the jdk11u-fix-request label in the JBS issue, along with some comment why you're requesting the backport, its testing etc., and waiting for the approval label. This is also true for net new items that aren't a downport of some existing fix as in your case. So, please add the JBS ceremony. Thx. |
Oh, of course! I was thinking of that as a 'backport thing', but I should have known that it was a wider requirement. Thanks for the head's up. I will add the 'JBS ceremony' :-) |
Haha. Maybe I should have. My understanding of
I agree with this assessment. If there is a strong preference to go with the other change minus the API changing code I would be open to that as well. |
Great. I approved it now and will also sponsor. /sponsor |
Going to push as commit 5e1ce54.
Your commit was automatically rebased without conflicts. |
@RealCLanger @backwaterred Pushed as commit 5e1ce54. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
While running some internal testing, a college has discovered a failure related to the Pack200 archive format on the zLinux platform. The problematic code was removed in the current repo by JDK-8234596, however that change was large, and required a CSR. I feel that it would be too risky and cumbersome to backport those changes to jdk11 (and ultimately jdk8 as well), so I'd like to propose this change as a new change to jdk11 rather than via the usual backport process.
Testing
These changes have been run against the failing test on zLinux and the Tier 1 tests completed successfully.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev pull/1163/head:pull/1163
$ git checkout pull/1163
Update a local copy of the PR:
$ git checkout pull/1163
$ git pull https://git.openjdk.org/jdk11u-dev pull/1163/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1163
View PR using the GUI difftool:
$ git pr show -t 1163
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/1163.diff