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

8271459: C2: Missing NegativeArraySizeException when creating StringBuilder with negative capacity #111

Closed
wants to merge 2 commits into from

Conversation

apavlyutkin
Copy link
Contributor

@apavlyutkin apavlyutkin commented Aug 23, 2022

Hi!

Here is a backport of JDK-8271459 that fixes lost NegativeArraySizeException on using StringBuilder of negative capacity. The patch from jdk-11 is applied cleanly except the path suffling.

Verification (amd64/Ubuntu 20.04): the reproducer from JBS throws 10000 of 10000 exceptions, and only ~55% (behaviour is non-deterministic) before the patch is applied

Regression: hotspot/test/runtime


Progress

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

Issue

  • JDK-8271459: C2: Missing NegativeArraySizeException when creating StringBuilder with negative capacity

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev pull/111/head:pull/111
$ git checkout pull/111

Update a local copy of the PR:
$ git checkout pull/111
$ git pull https://git.openjdk.org/jdk8u-dev pull/111/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 111

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/111.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 23, 2022

👋 Welcome back apavlyutkin! 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 changed the title Backport 844c504bc18fa8a79ceacc6b6f235650f5e643bf 8271459: C2: Missing NegativeArraySizeException when creating StringBuilder with negative capacity Aug 23, 2022
@openjdk
Copy link

openjdk bot commented Aug 23, 2022

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Aug 23, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 23, 2022

Webrevs

@yan-too
Copy link
Contributor

yan-too commented Aug 24, 2022

/clean

@openjdk openjdk bot added the clean label Aug 24, 2022
@openjdk
Copy link

openjdk bot commented Aug 24, 2022

@yan-too This backport pull request is now marked as clean

@openjdk
Copy link

openjdk bot commented Aug 24, 2022

@apavlyutkin This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8271459: C2: Missing NegativeArraySizeException when creating StringBuilder with negative capacity

Reviewed-by: roland

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

  • 43cfe27: 8269850: Most JDK releases report macOS version 12 as 10.16 instead of 12.0
  • 8280a89: 8295164: JDK 8 jdi tests should not use tasklist command on Windows
  • 05b249d: 8253702: BigSur version number reported as 10.16, should be 11.nn
  • 861ac32: 8293828: JFR: jfr/event/oldobject/TestClassLoaderLeak.java still fails when GC cycles are not happening
  • 4a25b00: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
  • 859c057: 8148005: One byte may be corrupted by get_datetime_string()
  • a93344b: 8294863: Enable partial tier1 testing in GHA for JDK8
  • d285382: 8293461: Add a test for JDK-8290832
  • f0ac319: 8195607: sun/security/pkcs11/Secmod/TestNssDbSqlite.java failed with "NSS initialization failed" on NSS 3.34.1
  • ba408e5: 8288928: Incorrect GPL header in pnglibconf.h (backport of JDK-8185041)
  • ... and 16 more: https://git.openjdk.org/jdk8u-dev/compare/8ad9018e42916b683e163c1c7629a9ba9962aed4...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.

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 (@rwestrel) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 24, 2022
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 21, 2022

@apavlyutkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@apavlyutkin
Copy link
Contributor Author

ping

@jerboaa
Copy link
Contributor

jerboaa commented Oct 11, 2022

@rwestrel Could you please review this? Does that look OK to you for 8u inclusion?

Copy link
Contributor

@rwestrel rwestrel left a comment

Choose a reason for hiding this comment

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

That looks good to me. Why not include the test case?

@rwestrel
Copy link
Contributor

@rwestrel Could you please review this? Does that look OK to you for 8u inclusion?

@jerboaa backporting this is reasonable I think.

@jerboaa
Copy link
Contributor

jerboaa commented Oct 11, 2022

@jerboaa backporting this is reasonable I think.

Thanks!

@apavlyutkin
Copy link
Contributor Author

apavlyutkin commented Oct 14, 2022

That looks good to me. Why not include the test case?

Original tests were not backported to the 11 because they are based on IR test framework that does not exists in the 11. I raised JDK-8295322 to re-factor the tests and incorporate them into the 11 and the 8.

@rwestrel
Copy link
Contributor

That looks good to me. Why not include the test case?

Original tests were not backported to the 11 because they are based on IR test framework that does not exists in the 11. I raised JDK-8295322 to re-factor the tests and incorporate them into the 11 and the 8.

Makes sense.

@apavlyutkin
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 14, 2022
@openjdk
Copy link

openjdk bot commented Oct 14, 2022

@apavlyutkin
Your change (at version be5b3a4) is now ready to be sponsored by a Committer.

@yan-too
Copy link
Contributor

yan-too commented Oct 14, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 14, 2022

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

  • 43cfe27: 8269850: Most JDK releases report macOS version 12 as 10.16 instead of 12.0
  • 8280a89: 8295164: JDK 8 jdi tests should not use tasklist command on Windows
  • 05b249d: 8253702: BigSur version number reported as 10.16, should be 11.nn
  • 861ac32: 8293828: JFR: jfr/event/oldobject/TestClassLoaderLeak.java still fails when GC cycles are not happening
  • 4a25b00: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
  • 859c057: 8148005: One byte may be corrupted by get_datetime_string()
  • a93344b: 8294863: Enable partial tier1 testing in GHA for JDK8
  • d285382: 8293461: Add a test for JDK-8290832
  • f0ac319: 8195607: sun/security/pkcs11/Secmod/TestNssDbSqlite.java failed with "NSS initialization failed" on NSS 3.34.1
  • ba408e5: 8288928: Incorrect GPL header in pnglibconf.h (backport of JDK-8185041)
  • ... and 16 more: https://git.openjdk.org/jdk8u-dev/compare/8ad9018e42916b683e163c1c7629a9ba9962aed4...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 14, 2022

@yan-too @apavlyutkin Pushed as commit dfeeceb.

💡 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
backport clean integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants