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

8253590: java/foreign tests are still failing on x86_32 after foreign-memaccess integration #386

Closed
wants to merge 2 commits into from

Conversation

mcimadamore
Copy link
Contributor

@mcimadamore mcimadamore commented Sep 28, 2020

This patch addresses a problem in a couple of tests for the foreign memory access API; we have two methods in the API, namely MemorySegment::asByteBuffer and MemorySegment::toByteArray which should throw an exception if invoked on a segment whose size is bigger than Integer.MAX_VALUE. The problem is that on 32-bits platform is not really possible to allocate a segment bigger than that; for that reason, at some point during 14 we "fixed" this by tweaking the test to allocate so much memory that the allocation itself would fail.

When we integrated the latest API changes, this dubious fix was reverted, and now the tests have started misbehaving again. A much better solution is not to rely on allocation; the two tests should just create a synthetic segment using MemorySegment::ofNativeRestricted; this way we can test that the API throws when it should, w/o being impacted by what Unsafe does, or does not support on 32-bits platforms.


Progress

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

Issue

  • JDK-8253590: java/foreign tests are still failing on x86_32 after foreign-memaccess integration

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 28, 2020

👋 Welcome back mcimadamore! 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 Sep 28, 2020
@openjdk
Copy link

openjdk bot commented Sep 28, 2020

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Sep 28, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 28, 2020

Webrevs

@openjdk
Copy link

openjdk bot commented Sep 29, 2020

@mcimadamore 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 more details.

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

8253590: java/foreign tests are still failing on x86_32 after foreign-memaccess integration

Reviewed-by: psandoz

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

  • 70b0fcc: 8253728: tests fail with "assert(fr.is_compiled_frame()) failed: Wrong frame type"
  • 527b0e4: 8248984: Bump minimum boot jdk to JDK 15
  • ac15d64: 8241151: Incorrect lint warning for no definition of serialVersionUID in a record
  • d25b03e: 8253616: Change to GCC 10.2 for building on Linux at Oracle

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Sep 29, 2020
@mcimadamore
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Sep 29, 2020
@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 Sep 29, 2020
@openjdk
Copy link

openjdk bot commented Sep 29, 2020

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

Your commit was automatically rebased without conflicts.

Pushed as commit ebf443a.

💡 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
2 participants