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

PrintRequestAttributeSet breaks page size macOS #174

Closed
tresf opened this Issue Feb 26, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@tresf
Contributor

tresf commented Feb 26, 2017

This is simply to track the upstream bug, since Oracle does not make it public information. This is something broken with the JRE that we discovered and reported August 2016. Logging it for historical purposes. No action on our part can be done until the JVM is repaired.

Oracle SR SR #3-13242741891, SR #3-17231848201.

STEPS

The issue can be reproduced at will with the following steps:
Steps to reproduce:

  1. Configure a default printer for the system to use either a virtual printer (such as Lisanet PDF Writer) or a printer capable of printing a 4" x 6" label.
  2. Run the attached PageSizeBug.java main(...), leaving the line "attributes.add(Chromacity... )" commented out.
  3. Notice the 4" x 6" page is properly printed.
  4. Un-comment the line "attributes.add(Chromacity...")
  5. Run the main(...) function
  6. Notice the page size has been reset to the printer default (usually A4 or Letter)

Open: Oracle SR SR #3-17231848201
PageBookSizeBug.zip

Closed: Oracle SR #3-13242741891
PageSizeBug.java.zip

@klabarge

This comment has been minimized.

Contributor

klabarge commented Apr 11, 2017

Oracle has provided us with a patched JDK for testing. With their patch, we are unable to reproduce this issue.

Oracle said that this fix will be publicly released in JDK 8u152

@klabarge

This comment has been minimized.

Contributor

klabarge commented Apr 11, 2017

Below is the Java version information from Oracle's fixed build, as @tresf mentioned that logic will need to be added to check for the Java version. Note that this fix is scheduled to be released in JDK 8u152

$ java -version
java version "1.8.0_121-030417y8167102y8061258"
Java(TM) SE Runtime Environment (build 1.8.0_121-030417y8167102y8061258-20170403100041.alitvino.jdk8u121-b99)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b99, mixed mode)
@tresf

This comment has been minimized.

Contributor

tresf commented Apr 17, 2017

Since Oracle SR #3-13242741891 is closed, to implement this properly, we need to do future version comparisons on a micro-level (e.g. u123 vs u456).

I'm currently looking for a Java SemVer parsing library as the one we've written for the 2.1 branch in it's current state is inadequate for backporting.

I found a very nice candidate -- JSemVer -- but it seems to break on Oracle versioning. Furthermore, replacing the _ underscore with a . period does not seem to fix it either. I've filed a support request with the upstream maintainer.

Edit: Found a workaround, by replacing _ underscore with - dash. Now the 2.0 branch is using JSemVer.

We'll need to follow-up with 2.1 branch and switch that to JSemVer as well.

@tresf

This comment has been minimized.

Contributor

tresf commented Jun 28, 2017

Just got an email from Oracle support:

Sustaining provides an update that we will need to rework the fix in this case. It maybe that the customer has to continue to use their workaround for 8u152. I will keep you posted on the development of Bug 24796421 (private).

This means we could have some problems once 8u152 is released. Will have to revert the patch.

Edit: Reverted via 938c9cd

@tresf tresf reopened this Jun 28, 2017

tresf added a commit that referenced this issue Jun 29, 2017

@tresf

This comment has been minimized.

Contributor

tresf commented Sep 19, 2017

Oracle has updated the ticket suggesting the fix will make it into 8u162. They have made no guarantee yet, but if they do, we can revert 938c9cd and change the check to 8u162.

@tresf

This comment has been minimized.

Contributor

tresf commented Dec 5, 2017

This is now slated for 8u172, this time the fix is expected to stick. Will revert 938c9cd and change the check to 8u172.

@tresf

This comment has been minimized.

Contributor

tresf commented Dec 5, 2017

Closed via d79b3ff.

@tresf tresf closed this Dec 5, 2017

@tresf

This comment has been minimized.

Contributor

tresf commented Dec 7, 2017

Oracle has notified us this will make the January release. Lowered version threshold to be enabled in Java8u162 instead of Java8u172 via 2873666.

@tresf

This comment has been minimized.

Contributor

tresf commented Apr 5, 2018

This is still broken in Java8u162. Reopening SR 3-13242741891, thus reopening this.

@tresf tresf reopened this Apr 5, 2018

@tresf

This comment has been minimized.

Contributor

tresf commented Apr 13, 2018

Turns out Oracle's fix worked for QZ Tray v2.0.2, but we went and found a way to break it again in QZ Tray v2.0.3. We're discussing this under SR 3-13242741891 currently. We believe the Book class to be the cause but we're not 100% sure on that yet. Will post updates as we find them.

Edit: New test case available, uploaded to SR: https://github.com/qzind/tray/files/1909917/PageBookSizeBug.zip

@tresf

This comment has been minimized.

Contributor

tresf commented Sep 4, 2018

Oracle has patched this in a private build for us again, here's their latest update in SR 3-17231848201:

[Oracle has] attached a Fix Verification Binary for you to try. It is named [ fvb1-jdk-8u181-290818y8201818-macosx-x86_64.dmg ]. Download it from the attachments section of this service request. It should correct the problem but it is still a preliminary fix. It is not ready for production use. While we ask you to try it to see if it corrects the problem, once you have the results, you should not use it any further.

@klabarge can you please test?

@klabarge

This comment has been minimized.

Contributor

klabarge commented Sep 6, 2018

@tresf I tested Oracle's patched Java version fvb1-jdk-8u181-290818y8201818-macosx-x86_64.dmg against the test case you provided and it does appear to fix the bug.

I also tested by removing the attributes.clear(); logic and running against the provided JDK.

Let me know if you would like me to run any further tests

@tresf

This comment has been minimized.

Contributor

tresf commented Sep 27, 2018

Oracle can't yet guarantee a release version that fixes this. Once they have a version number, we'll bump our code to use it. It'll be fixed in 1.8.0+202.

@tresf tresf closed this in 7cb8ef9 Oct 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment