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

8241370: Crash in JPEGImageLoader after fix for JDK-8212034 #154

Closed
wants to merge 2 commits into from

Conversation

arapte
Copy link
Member

@arapte arapte commented Mar 31, 2020

This is a regression of JDK-8212034.
When image is loaded in WebView usinga url, WebView attempts to load a image frames with partial image data. This was implemented under,
JDK-8153148 -> WCImageDecoderImpl.addImageData() -> calls loadFrames() with partial image data.

Call to jpeg_read_header() may fail when the partial image data has incomplete header information.

In the given case the jpeg_read_header() call fails and code execution flow enters the 'if (setjmp(jerr->setjmp_buffer)) {}' block and results in call to disposeIIO(env, data);, which in turn calls imageio_dispose. This will free cinfo->err and set it to NULL, and the subsequent call to (*cinfo->err->format_message) crashes.

Verified All test run, Sanity tests with Ensemble app and Tested different web pages.
Added a test, The test passes with fix and causes a native crash without the fix.


Progress

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

Issue

  • JDK-8241370: Crash in JPEGImageLoader after fix for JDK-8212034

Reviewers

  • Kevin Rushforth (kcr - Reviewer)

Download

$ git fetch https://git.openjdk.java.net/jfx pull/154/head:pull/154
$ git checkout pull/154

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 31, 2020

👋 Welcome back arapte! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request.

@openjdk openjdk bot added the rfr Ready for review label Mar 31, 2020
@mlbridge
Copy link

mlbridge bot commented Mar 31, 2020

Webrevs

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good. I can also confirm that the test fails (crashes) without your fix and passes with your fix.

The new LoadCorruptJPEGTest.java test doesn't use Robot, so it should be moved to a package not underneath test.robot. For consistency with similar tests in javafx.graphics, I recommend test.com.sun.javafx.iio.

I left a few other comments on the test.

@kevinrushforth
Copy link
Member

@johanvos This is a simple enough fix that I don't think it needs a second reviewer. Feel free to review it if you like.

@openjdk
Copy link

openjdk bot commented Apr 2, 2020

@arapte This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

8241370: Crash in JPEGImageLoader after fix for JDK-8212034

Reviewed-by: kcr
  • 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 /solves command.

Since the source branch of this PR was last updated there have been 9 commits pushed to the master branch. Since 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 159f6516879ca1d176223b2e28ee19a0ad1e3e19.

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

@openjdk openjdk bot added the ready Ready to be integrated label Apr 2, 2020
@arapte
Copy link
Member Author

arapte commented Apr 3, 2020

/integrate

@openjdk openjdk bot closed this Apr 3, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated rfr Ready for review labels Apr 3, 2020
@openjdk
Copy link

openjdk bot commented Apr 3, 2020

@arapte The following commits have been pushed to master since your change was applied:

  • 159f651: 8240542: Switch FX build to use JDK 14 as boot JDK
  • 6d098fe: 8234959: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
  • d7f13f4: 8089828: RTL Orientation, the flag of a mnemonic is not placed under the mnemonic letter.
  • 9ecc107: 8240539: Upgrade gradle to version 6.3
  • f3a3ea0: 8234471: Canvas in webview displayed with wrong scale on Windows
  • d12e71c: 8241474: Build failing on Ubuntu 20.04
  • 2a7ab36: 8089134: [2D traversal, RTL] TraversalEngine only handles left/right key traversal correctly in RTL for top-level engine in ToolBar
  • 2aa8218: 8235480: Regression: [RTL] Arrow keys navigation doesn't respect TableView orientation
  • e9c6119: 8240692: Cleanup of the javafx property objects

Your commit was automatically rebased without conflicts.

Pushed as commit 5906521.

@arapte arapte deleted the JPEG_crash branch April 28, 2020 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
2 participants