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

JDK-8298093: improve cleanup and error handling of awt_parseColorModel in awt_parseImage.c #11508

Closed
wants to merge 3 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Dec 5, 2022

The cleanup and error handling in function awt_parseColorModel in awt_parseImage.c could be improved.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8298093: improve cleanup and error handling of awt_parseColorModel in awt_parseImage.c

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11508/head:pull/11508
$ git checkout pull/11508

Update a local copy of the PR:
$ git checkout pull/11508
$ git pull https://git.openjdk.org/jdk pull/11508/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11508

View PR using the GUI difftool:
$ git pr show -t 11508

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11508.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 5, 2022

👋 Welcome back mbaesken! 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 Pull request is ready for review label Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@MBaesken The following label will be automatically applied to this pull request:

  • client

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 pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Dec 5, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 5, 2022

Webrevs

awt_freeParsedRaster(&imageP->raster, FALSE);
if (cmP->nBits != NULL) free(cmP->nBits);
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems wrong to me that awt_parseColorModel should return a failure code and not have cleaned up any storage it itself allocated.
In other words this clean up belongs in there.

Copy link
Member Author

@MBaesken MBaesken Dec 6, 2022

Choose a reason for hiding this comment

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

Hi Phil, I moved the cleanup.

Another question - what do you think about introducing a macro JNU_CHECK_EXCEPTION_FREE_RETURN ? We have quite a number of places using this pattern (exception check , free and return) , in this change now as well. Might be worth having a macro for this.

@MBaesken
Copy link
Member Author

MBaesken commented Dec 7, 2022

Hi Phil, are you fine with the latest version ?

Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for fixing this.

@openjdk
Copy link

openjdk bot commented Dec 7, 2022

@MBaesken 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:

8298093: improve cleanup and error handling of awt_parseColorModel in awt_parseImage.c

Reviewed-by: lucy, clanger

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 161 new commits pushed to the master branch:

  • ed8a212: 8298376: ZGC: thaws stackChunk with stale oops
  • 2e801e1: 8298475: Remove JVM_ACC_PROMOTED_FLAGS
  • 9ee5037: 8298636: Fix return value in WB_CountAliveClasses and WB_GetSymbolRefcount
  • ceca4fc: 8298264: Merge OffsetTableContigSpace into TenuredSpace
  • d32d6c0: 8297791: update _max_classes in node type system
  • b754aa5: 8298371: monitors_on_stack extracts unprocessed oops
  • 220781f: 8298513: vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009/TestDescription.java fails with usage tracker
  • a120764: 8298514: vmTestbase/nsk/jdi/EventRequestManager/threadDeathRequests/thrdeathreq002/TestDescription.java fails with usage tracker
  • 6802277: 8298524: Debug function to trace reachability of CDS archived heap objects
  • 23e1827: Merge
  • ... and 151 more: https://git.openjdk.org/jdk/compare/777fb52ef5b0d95b756ce4fa71a7ddf2d7d2a8f1...master

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.

➡️ 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 Pull request is ready to be integrated label Dec 7, 2022
@@ -454,6 +454,7 @@ int awt_parseColorModel (JNIEnv *env, jobject jcmodel, int imageType,

int i;
static jobject s_jdefCM = NULL;
cmP->nBits = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could leave the cmP->nBits initialization where it was. But that's just a nit.

@MBaesken
Copy link
Member Author

Hi Christoph and Lutz, thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented Dec 15, 2022

Going to push as commit 98fa48c.
Since your change was applied there have been 187 commits pushed to the master branch:

  • 5f63f7a: 8298726: (fs) Change PollingWatchService to record last modified time as FileTime rather than milliseconds
  • 3ae7187: 8298498: sun/net/www/http/KeepAliveCache/B8291637.java fails with "Server exception terminating: java.net.SocketException: Socket closed"
  • b9074fa: 8298249: Excessive memory allocation in CipherInputStream AEAD decryption
  • 10bc86c: Merge
  • 80cadd4: 8298785: gc/TestFullGCCount.java fails with "invalid boolean value: null' for expression vm.opt.ExplicitGCInvokesConcurrent'"
  • ebc4710: 8298277: Replace "session" with "scope" for FFM access
  • d1085d1: 8281946: VM.native_memory should report size of shareable memory
  • 3ef3824: 8298794: Remove JVM_ACC_PROMOTED_FLAGS breaks minimal build
  • 0ed6d0b: 8297296: java/awt/Mouse/EnterExitEvents/DragWindowTest.java fails with "No MouseReleased event on label!"
  • a130c8a: Merge
  • ... and 177 more: https://git.openjdk.org/jdk/compare/777fb52ef5b0d95b756ce4fa71a7ddf2d7d2a8f1...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 15, 2022
@openjdk openjdk bot closed this Dec 15, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 15, 2022
@openjdk
Copy link

openjdk bot commented Dec 15, 2022

@MBaesken Pushed as commit 98fa48c.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants