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

8264827: Large mapped buffer/segment crash the VM when calling isLoaded #3378

Closed
wants to merge 3 commits into from

Conversation

ChrisHegarty
Copy link
Member

@ChrisHegarty ChrisHegarty commented Apr 7, 2021

Avoid overflow when calculating the number of pages for large mapped segment sizes.


Progress

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

Issue

  • JDK-8264827: Large mapped buffer/segment crash the VM when calling isLoaded

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3378/head:pull/3378
$ git checkout pull/3378

Update a local copy of the PR:
$ git checkout pull/3378
$ git pull https://git.openjdk.java.net/jdk pull/3378/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3378

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3378.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 7, 2021

👋 Welcome back chegar! 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
Copy link

openjdk bot commented Apr 7, 2021

@ChrisHegarty The following labels will be automatically applied to this pull request:

  • core-libs
  • nio

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

@openjdk openjdk bot added nio nio-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Apr 7, 2021
@ChrisHegarty ChrisHegarty marked this pull request as ready for review April 8, 2021 18:18
@ChrisHegarty ChrisHegarty changed the title Large mapped buffer/segment crash the VM when calling isLoaded 8264827: Large mapped buffer/segment crash the VM when calling isLoaded Apr 9, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 9, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 9, 2021

Webrevs

@ChrisHegarty
Copy link
Member Author

Note for reviewers on the test. A 3GB file is sufficient to demonstrate the issue in the old code, as follows (with a 4K page size, since the narrowing cast of size is the significant issue):

jshell> int pageSize() { return 4 * 1024; }
|  created method pageSize()

jshell> int pageCount(long size) { return (int)(size + (long)pageSize() - 1L) / pageSize(); }
|  created method pageCount(long)

jshell> pageCount(3L * 1024L * 1024L * 1024L)
$3 ==> -262143

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

Looks okay to me.

@openjdk
Copy link

openjdk bot commented Apr 9, 2021

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

8264827: Large mapped buffer/segment crash the VM when calling isLoaded

Reviewed-by: alanb, mcimadamore

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

  • e604320: 8264783: G1 BOT verification should not verify beyond allocation threshold
  • cb2806d: 8265018: [AIX] FileDispatcherImpl.c:31:10: fatal error: 'sys/mount.h' file not found
  • ecef1fc: 8264972: Unused TypeFunc declared in OptoRuntime
  • 440c34a: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph
  • b1ebf82: 8264358: Don't create invalid oop in method handle tracing
  • 627ad9f: 8262328: Templatize JVMFlag boilerplate access methods
  • c15680e: 8264868: Reduce inclusion of registerMap.hpp and register.hpp
  • 5784f6b: 8264948: Check for TLS extensions total length
  • 42f4d70: 8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB
  • 76bd313: 8264872: Dependencies: Migrate to PerfData counters
  • ... and 45 more: https://git.openjdk.java.net/jdk/compare/9d6503978dfab9e6161594462882d5e53425e8b1...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 Apr 9, 2021
Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Looks good - thanks for fixing.

@ChrisHegarty
Copy link
Member Author

/integrate

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

openjdk bot commented Apr 12, 2021

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

  • e604320: 8264783: G1 BOT verification should not verify beyond allocation threshold
  • cb2806d: 8265018: [AIX] FileDispatcherImpl.c:31:10: fatal error: 'sys/mount.h' file not found
  • ecef1fc: 8264972: Unused TypeFunc declared in OptoRuntime
  • 440c34a: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph
  • b1ebf82: 8264358: Don't create invalid oop in method handle tracing
  • 627ad9f: 8262328: Templatize JVMFlag boilerplate access methods
  • c15680e: 8264868: Reduce inclusion of registerMap.hpp and register.hpp
  • 5784f6b: 8264948: Check for TLS extensions total length
  • 42f4d70: 8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB
  • 76bd313: 8264872: Dependencies: Migrate to PerfData counters
  • ... and 45 more: https://git.openjdk.java.net/jdk/compare/9d6503978dfab9e6161594462882d5e53425e8b1...master

Your commit was automatically rebased without conflicts.

Pushed as commit 3c9858d.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated nio nio-dev@openjdk.org
3 participants