Skip to content
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

8252100: NumberOverflow in class MemoryCache #182

Closed
wants to merge 1 commit into from

Conversation

@jayathirthrao
Copy link
Member

@jayathirthrao jayathirthrao commented Sep 15, 2020

Number overflow in javax/imageio/stream/MemoryCache.java
I tried to reproduce the issue but was not able to create stream or BufferedImage of such a large size because of array size limitations. Submitter has mentioned simple fix for overflow which has solved his issue. I have verified the fix by running jtreg and compatibility tests and there are no failures.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/182/head:pull/182
$ git checkout pull/182

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 15, 2020

👋 Welcome back jdv! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Sep 15, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 15, 2020

@jayathirthrao The following label will be automatically applied to this pull request: 2d.

When this pull request is ready to be reviewed, an RFR email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label (add|remove) "label" command.

@openjdk openjdk bot added the 2d label Sep 15, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 15, 2020

Webrevs

prrace
prrace approved these changes Sep 15, 2020
Copy link
Contributor

@prrace prrace left a comment

If pos is big enough you could still theoretically have overflow, but this is still better.

@openjdk
Copy link

@openjdk openjdk bot commented Sep 15, 2020

@jayathirthrao This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8252100: NumberOverflow in class MemoryCache

Reviewed-by: prr, serb
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 30 commits pushed to the master branch:

  • 9a7dcdc: 8253261: Disable CDS full module graph until JDK-8253081 is fixed
  • 1c84cfa: 8253130: bug7072653.java failed "Popup window height ... is wrong"
  • ce93cbc: 8253125: vmTestbase/nsk/stress/stack/stack017.java timed out
  • d250f9e: 8253244: Shenandoah: cleanup includes in Shenandoah root processor files
  • d38c97d: 8253207: enable problemlists jcheck's check
  • 671dfba: 6714834: JarFile.getManifest() leaves an open InputStream as an undocumented side effect
  • e5866aa: 8244706: GZIP "OS" header flag hard-coded to 0 instead of 255 (RFC 1952 non-compliance)
  • 1086713: 8253206: Enforce whitespace checking for additional source files
  • e2196f8: 8253162: Make frame::oops_do const
  • 300b851: 8253226: Shenandoah: remove unimplemented ShenandoahStrDedupQueue::verify
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/d219d8b9871be037815413e6f52bc85ebac8db2a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 9a7dcdcdbad34e061a8988287fe691abfd4df305.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Sep 15, 2020
@mrserb
Copy link
Member

@mrserb mrserb commented Sep 16, 2020

You can try to create such images using some separate tools, BTW I have found one here(32768 × 32768):
https://forums.bohemia.net/forums/topic/202016-high-quality-maps-for-altis-and-stratis/

@jayathirthrao
Copy link
Member Author

@jayathirthrao jayathirthrao commented Sep 16, 2020

Hi Sergey,

I tried reading images from https://forums.bohemia.net/forums/topic/202016-high-quality-maps-for-altis-and-stratis/, we are trying to create destination BufferedImage of huge size and again we will hit:

Exception in thread "main" java.lang.IllegalArgumentException: Invalid scanline stride
at java.desktop/java.awt.image.ComponentSampleModel.getBufferSize(ComponentSampleModel.java:268)

where we check scanline with Integer.MAX_VALUE. From the description in JBS i can see that submitter has his own plugin for TIFF and that is the only reason that he is able to read such a large images. With default plugin we will hit this issue whenever we try to read large images as it is not supported.

Thanks,
Jay

mrserb
mrserb approved these changes Sep 17, 2020
@jayathirthrao
Copy link
Member Author

@jayathirthrao jayathirthrao commented Sep 17, 2020

/integrate

@openjdk openjdk bot closed this Sep 17, 2020
@openjdk openjdk bot added integrated and removed ready labels Sep 17, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 17, 2020

@jayathirthrao Since your change was applied there have been 30 commits pushed to the master branch:

  • 9a7dcdc: 8253261: Disable CDS full module graph until JDK-8253081 is fixed
  • 1c84cfa: 8253130: bug7072653.java failed "Popup window height ... is wrong"
  • ce93cbc: 8253125: vmTestbase/nsk/stress/stack/stack017.java timed out
  • d250f9e: 8253244: Shenandoah: cleanup includes in Shenandoah root processor files
  • d38c97d: 8253207: enable problemlists jcheck's check
  • 671dfba: 6714834: JarFile.getManifest() leaves an open InputStream as an undocumented side effect
  • e5866aa: 8244706: GZIP "OS" header flag hard-coded to 0 instead of 255 (RFC 1952 non-compliance)
  • 1086713: 8253206: Enforce whitespace checking for additional source files
  • e2196f8: 8253162: Make frame::oops_do const
  • 300b851: 8253226: Shenandoah: remove unimplemented ShenandoahStrDedupQueue::verify
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/d219d8b9871be037815413e6f52bc85ebac8db2a...master

Your commit was automatically rebased without conflicts.

Pushed as commit b87a159.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@openjdk openjdk bot removed the rfr label Sep 17, 2020
@jayathirthrao jayathirthrao deleted the JDK-8252100 branch Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants